国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

mysql用戶可免密碼登錄問題處理解決

這篇具有很好參考價(jià)值的文章主要介紹了mysql用戶可免密碼登錄問題處理解決。希望對大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

參考文章:點(diǎn)擊跳轉(zhuǎn)

現(xiàn)象描述

任意用戶可登錄MySQL數(shù)據(jù)庫。如下面操作。會(huì)發(fā)現(xiàn),此時(shí)登錄后無法查看到正常的全部數(shù)據(jù)庫,只能看到系統(tǒng)默認(rèn)的測試數(shù)據(jù)庫test和信息庫infomation_schema。

else@linux-ctc7:~> mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.1.73-community MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| test               |
+--------------------+
2 rows in set (0.00 sec)

分析

正常登錄該數(shù)據(jù)庫,查看用戶表,第四列里面,host為localhost,用戶為空,密碼為空。導(dǎo)致在本地登陸的時(shí)候除了root的賬戶外,其他賬號不需要密碼即可登陸,并且影響host為%的用戶登陸。

else@linux-ctc7:~> mysql -uroot -pmysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.1.73-community MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select host,user,password from user;
+------------+------+-------------------------------------------+
| host       | user | password                                  |
+------------+------+-------------------------------------------+
| %          | root | *E74858DB86EBA20BC33D0AECAE8A8108C56B17FA |
| linux-ctc7 | root |                                           |
| 127.0.0.1  | root |                                           |
| localhost  |      |                                           |
| linux-ctc7 |      |                                           |
+------------+------+-------------------------------------------+
5 rows in set (0.00 sec)

mysql> 

解決

刪除空用戶。然后重啟數(shù)據(jù)庫。不重啟數(shù)據(jù)庫不生效。文章來源地址http://www.zghlxwxcb.cn/news/detail-637494.html

mysql> select host,user from user;
+------------+------+
| host       | user |
+------------+------+
| %          | root |
| 127.0.0.1  | root |
| linux-ctc7 |      |
| linux-ctc7 | root |
| localhost  |      |
| localhost  | test |
+------------+------+
6 rows in set (0.00 sec)
mysql> delete from user where host='localhost' and user='';
Query OK, 1 row affected (0.00 sec)
mysql> delete from user where host='linux-ctc7' and user='';
Query OK, 1 row affected (0.00 sec)

//不重啟數(shù)據(jù)庫不生效。重啟后生效。
else@linux-ctc7:~> mysql -u else             ---重啟數(shù)據(jù)庫前仍可登錄
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 5.1.73-community MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/o its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
linux-ctc7:/etc/init.d # ./mysql stop
Shutting down MySQL..                                                 done
linux-ctc7:/etc/init.d # ps -ef|grep mysql
root      5561  5490  0 09:03 pts/1    00:00:00 grep mysql
linux-ctc7:/etc/init.d # ./mysql start
Starting MySQL.                                                       done
linux-ctc7:/etc/init.d # mysql       ---重啟數(shù)據(jù)庫后,root用戶無法直接連接。
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
else@linux-ctc7:~> mysql -u else     ---重啟數(shù)據(jù)庫后,普通用戶無法直接連接。
ERROR 1045 (28000): Access denied for user 'else'@'localhost' (using password: NO)

到了這里,關(guān)于mysql用戶可免密碼登錄問題處理解決的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 【centos 7】 用戶開機(jī)登錄密碼忘記解決辦法

    【centos 7】 用戶開機(jī)登錄密碼忘記解決辦法

    1、重啟系統(tǒng),開機(jī)進(jìn)入GRUB界面,在引導(dǎo)程序菜單上進(jìn)行選擇 2、按\\\"e\\\"鍵進(jìn)入 3、用上下箭頭翻到最后,編輯修改兩處: 【ro改為rw】【LANG=en_US.UFT-8后面添加init=/bin/sh】 【若命令行顯示LANG=en_US.UFT-8 可以修改為LANG=zh_CN.UFT-8】 【若命令行顯示LANG=zh_CN.UFT-8 可以修改為LANG=en_US.UFT

    2024年02月09日
    瀏覽(26)
  • MySQL修改登錄密碼

    適用于可以登錄進(jìn)入mysql數(shù)據(jù)庫,想修改密碼或者提示密碼過期 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement 如果忘記密碼可以看Linux系統(tǒng)MySQL忘記登錄密碼-CSDN博客這篇文章 方法一: 方法二: 方法三: 方法四: 如果提示:ERROR 1819 (HY00

    2024年02月02日
    瀏覽(18)
  • Docker登錄MySQL,密碼正確卻提示密碼錯(cuò)誤

    Docker登錄MySQL,密碼正確卻提示密碼錯(cuò)誤

    ?當(dāng)我輸入了正確的MySQL密碼的時(shí)候確提示我密碼錯(cuò)誤: 這是由于之前的掛載點(diǎn)的數(shù)據(jù)沒有刪除干凈,刪除掉宿主機(jī)下的mysql_master文件即可

    2024年01月22日
    瀏覽(16)
  • windows上Mysql登錄步驟(忘記密碼登錄步驟)

    windows上Mysql登錄步驟(忘記密碼登錄步驟)

    一、記得密碼情況 1、cmd以管理員身份進(jìn)入命令提示符窗口 2、輸入net start mysql啟動(dòng)mysql服務(wù) 3、輸入mysql -uroot -p+密碼 進(jìn)入mysql ? 二、若忘記密碼進(jìn)入方式(修改密碼的方式) 1、以管理員身份進(jìn)入后輸入net stop mysql關(guān)閉mysql服務(wù) 2、輸入mysqld --console --skip-grant-tables --shared-memor

    2024年02月05日
    瀏覽(10)
  • 解決“Can‘t connect to MySQL server on ‘localhost:3306‘ (10061)“MySQL登錄報(bào)錯(cuò)問題

    1.按下”Win“+”R鍵“打開運(yùn)行 2.輸入” services.msc“ 3.找到MYSQL一項(xiàng),右鍵點(diǎn)擊屬性 4.在屬性中:將“啟動(dòng)類型”改為“自動(dòng)” 5.在屬性中:點(diǎn)擊“服務(wù)狀態(tài)”下的“啟動(dòng)”后,MySQL便可以正常登錄。 ? 1.按下“Win+R”鍵打開運(yùn)行 2.輸入\\\"cmd\\\"打開控制臺(tái),打開控制臺(tái)后,在控制

    2024年02月07日
    瀏覽(15)
  • jenkins忘記用戶名以及登錄密碼的解決方法

    jenkins忘記用戶名以及登錄密碼的解決方法

    1. 進(jìn)入到安裝jenkins路徑,找到j(luò)enkins安裝的配置文件 config.xml? 比如我的jenkins安裝路徑如下圖: 2. 打開config.xml文件夾,搜索到useSecurity 將useSecurity的屬性改為false 如下圖所示: ?然后重啟jenkins server,然后就可以進(jìn)入到j(luò)enkins主主主頁面了。 3.?進(jìn)入系統(tǒng)管理的管理用戶就可以

    2024年02月04日
    瀏覽(18)
  • mysql8.0更改用戶密碼

    mysql8.0更改用戶密碼

    1、mysql 啟動(dòng)命令 : mysql -uroot -p 2、mysql版本 查看命令: select version(); image.png 3、查看用戶名對應(yīng)的host 命令 : select user,host from user; image.png 4、修改用戶的密碼: alter user \\\'用戶名\\\'@\\\'hostname\\\' identified by \\\'newpwd\\\'; ---‘用戶名’是要修改的用戶名,hostname是user對應(yīng)的host,‘newpwd’是

    2023年04月08日
    瀏覽(12)
  • mysql 8.0版本更換用戶密碼

    mysql 8.0版本更換用戶密碼

    1、首先 cmd 進(jìn)入命令行 ?2、查詢版本號 3、看一下數(shù)據(jù)庫 4、使用mysql即可 5、進(jìn)行查詢 user、host 6、修改root的密碼 7、刷新權(quán)限

    2024年02月11日
    瀏覽(18)
  • 處理普通用戶安裝啟動(dòng)mysql報(bào)Can‘t find error-message file‘usrsharemysqlerrmsg.sys‘ 問題

    操作系統(tǒng):centos7 mysql版本:5.7.29 使用普通用戶安裝完成以后,啟動(dòng)mysql: /data/mysql/usr/sbin/mysqld --defaults-file=/data/mysql/etc/my.cnf --user=dongzw 日志中報(bào): [ ERROR ] Can’t find error-message file \\\'/usr/share/mysql/ errmsg.sys’ . Check error-message file location and ‘lc-messages-dir’ configuration directive. 大概

    2024年02月15日
    瀏覽(13)
  • MySQL 8.0.31 登錄提示caching_sha2_password問題解決方法

    MySQL 8.0.31 使用了 caching_sha2_password 作為默認(rèn)的身份驗(yàn)證插件,這可能導(dǎo)致一些舊的客戶端和庫無法連接到服務(wù)器。以下是一些解決此類問題的常見步驟和建議: 確保MySQL服務(wù)正在運(yùn)行:首先,確保你的MySQL服務(wù)器實(shí)例正在運(yùn)行。你可以使用系統(tǒng)的服務(wù)管理工具來檢查。 更新你

    2024年02月12日
    瀏覽(24)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包