人妖在线一区,国产日韩欧美一区二区综合在线,国产啪精品视频网站免费,欧美内射深插日本少妇

新聞動態(tài)

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

發(fā)布日期:2022-08-05 13:31 | 文章來源:站長之家
錯誤描述: Mysql中添加用戶之后可能出現(xiàn)登錄時提示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.意外的情況: 如果上述方法沒有效果,依然出現(xiàn)空用戶,則可以利用圖形化用戶client刪除.
在重裝了CentOS后,發(fā)覺Mysql一直不好用。
# mysqladmin create dbname 命令老是返回mysqladmin: connect to server at ’localhost’ failed
# mysql -u root@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)
使用網(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)在終于被我找到了解決方法,如下(請先測試方法三,謝謝?。?
方法一:
# /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)行過測試,因為我的root用戶默認(rèn)密碼已經(jīng)被我修改過了,那位有空測試一下,把結(jié)果告訴我,謝謝!
# mysql -uroot -p
Enter password: <輸入/etc/mysql/debian.cnf文件中[client]節(jié)提供的密碼>
至此,困惑多時的問題解決了!

香港服務(wù)器租用

版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。

實時開通

自選配置、實時開通

免備案

全球線路精選!

全天候客戶服務(wù)

7x24全年不間斷在線

專屬顧問服務(wù)

1對1客戶咨詢顧問

在線
客服

在線客服:7*24小時在線

客服
熱線

400-630-3752
7*24小時客服服務(wù)熱線

關(guān)注
微信

關(guān)注官方微信
頂部