国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Linux > 正文

ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)

2020-06-13 12:44:44
字體:
來源:轉載
供稿:網友

錯誤描述: Mysql中添加用戶之后可能出現登錄時提示ERROR 1045 (28000): Access denied for user的錯誤.刪除user.user中值為NULL的,或更新NULL為test 1)delete from user where user is NULL 2)update user set user=‘test‘ where user is NULL.意外的情況: 如果上述方法沒有效果,依然出現空用戶,則可以利用圖形化用戶client刪除.

在重裝了CentOS后,發覺Mysql一直不好用。

# mysqladmin create dbname 命令老是返回mysqladmin: connect to server at ’localhost’ failed

# mysql -uroot@localhost

>create database dbname;

也同樣返回錯誤ERROR 1045 (28000): Access denied for user’root’@’localhost’(using password: NO)

# mysql -u root -p

Enter password:

ERROR 1045 (28000): Access denied for user’root’@’localhost’(using password: NO)

使用網上介紹的方法修改root用戶的密碼:

# mysqladmin -uroot -p password ’newpassword’

Enter password:

mysqladmin: connect to server at ’localhost’ failed

error: ’Access denied for user’root’@’localhost’(using password: YES)’

現在終于被我找到了解決方法,如下(請先測試方法三,謝謝!):

方法一:

# /etc/init.d/mysql stop

# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

# mysql -u root mysql

mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;

mysql> FLUSH PRIVILEGES;

mysql> quit

# /etc/init.d/mysql restart

# mysql -uroot -p

Enter password: <輸入新設的密碼newpassword>

mysql>

方法二:

直接使用/etc/mysql/debian.cnf文件中[client]節提供的用戶名和密碼:

# mysql -udebian-sys-maint -p

Enter password: <輸入[client]節的密碼>

mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;

mysql> FLUSH PRIVILEGES;

mysql> quit

# mysql -uroot -p

Enter password: <輸入新設的密碼newpassword>

mysql>

方法三:

這種方法我沒有進行過測試,因為我的root用戶默認密碼已經被我修改過了,那位有空測試一下,把結果告訴我,謝謝!

# mysql -uroot -p

Enter password: <輸入/etc/mysql/debian.cnf文件中[client]節提供的密碼>

至此,困惑多時的問題解決了!


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 天长市| 宁国市| 班戈县| 营口市| 金沙县| 盐亭县| 亳州市| 锡林浩特市| 洞口县| 马公市| 延吉市| 钟山县| 罗城| 民县| 顺平县| 张家川| 巫山县| 广丰县| 扎赉特旗| 三台县| 涿州市| 睢宁县| 易门县| 夏邑县| 灵武市| 恩施市| 肇东市| 民县| 无锡市| 武冈市| 普陀区| 武平县| 汝南县| 丹东市| 密山市| 民和| 宜川县| 凉城县| 乡城县| 兖州市| 调兵山市|