欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

本站整理   發(fā)布時(shí)間:2009-03-10 15:28:22   作者:jb51.net   我要評論
錯(cuò)誤描述: Mysql中添加用戶之后可能出現(xiàn)登錄時(shí)提示ERROR 1045 (28000): Access denied for user的錯(cuò)誤.刪除user.user中值為NULL的,或更新NULL為test 1)delete from user where user is NULL 2)update user set user=‘test‘ where user is NULL.意外的情況: 如果

錯(cuò)誤描述: Mysql中添加用戶之后可能出現(xiàn)登錄時(shí)提示ERROR 1045 (28000): Access denied for user的錯(cuò)誤.刪除user.user中值為NULL的,或更新NULL為test 1)delete from user where user is NULL 2)update user set user=‘test‘ where user is NULL.意外的情況: 如果上述方法沒有效果,依然出現(xiàn)空用戶,則可以利用圖形化用戶client刪除.
在重裝了CentOS后,發(fā)覺Mysql一直不好用。
# mysqladmin create dbname 命令老是返回mysqladmin: connect to server at ’localhost’ failed
# mysql -u-root@localhost 
>create database dbname;  
也同樣返回錯(cuò)誤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)
使用網(wǎng)上介紹的方法修改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)’
現(xiàn)在終于被我找到了解決方法,如下(請先測試方法三,謝謝?。?br />方法一:
# /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: <輸入新設(shè)的密碼newpassword>
mysql>
方法二:
直接使用/etc/mysql/debian.cnf文件中[client]節(jié)提供的用戶名和密碼:
# mysql -udebian-sys-maint -p
Enter password: <輸入[client]節(jié)的密碼>
mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;
mysql> FLUSH PRIVILEGES;
mysql> quit
# mysql -uroot -p
Enter password: <輸入新設(shè)的密碼newpassword>
mysql>
方法三:
這種方法我沒有進(jìn)行過測試,因?yàn)槲业膔oot用戶默認(rèn)密碼已經(jīng)被我修改過了,那位有空測試一下,把結(jié)果告訴我,謝謝!
# mysql -uroot -p
Enter password: <輸入/etc/mysql/debian.cnf文件中[client]節(jié)提供的密碼>
至此,困惑多時(shí)的問題解決了!

相關(guān)文章

最新評論