360AI搜索?試了下,感覺還是挺不錯的。
比如問這個問題:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
它的回答:
對于ERROR 1698 (28000): Access denied for user 'root'@'localhost'的問題,這通常是由于MySQL密碼為空或者密碼錯誤導致的。以下是解決這個問題的幾種方法:
1. 使用mysql -udebian-sys-maint -p進入MySQL,這時需要mysql提供給你的密碼,輸入sudo vim /etc/mysql/debian.cnf password就是密碼,進入后重新設置root賬號密碼UPDATE user SET authentication_string=PASSWORD('你的密碼') where USER ='root';退出重啟服務后還是報錯,但是密碼還是改成功了,查看select user,plugin from user錯誤原因是因為plugin root的字段是auth_socket改掉就行update user set authentication_string =password('你的密碼'),plugin=...[1] 。
2. 在Ubuntu終端輸入如下命令sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf 進入到mysqld.cnf 配置文件,然后在這個配置文件中的[mysqld]這一塊中加入skip-grant-tables這句話。[mysqld]# #* Basic options *-user =root# #* Advanced options#-skip-grant-tables[2] 。
3. 使用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...[3] 。
4. 經常會發現有很多人出現數據庫訪問被拒絕的問題,這種情況一般多發于新版的(ubuntu18.04)linux系統上,其他的linux也可能會出現這樣的問題,比如deepin(超贊的國產Linux系統),Manjaro系統等,問題報錯如下:mysql: [Warning] Using a password with the mysql client for security reasons is deprecated and will be removed in a future release. Please consider using a cookie or equivalent instead.[4] 。
5. 之前mysql用著好著,可是今天在啟動mysql后輸入密碼出現了閃退,在任務管理器中發現mysql服務沒有啟動,當手動啟動時提示拒絕訪問。mysql數據庫中1045錯誤的解決方法。[5] 。
引文:
[1] https://www.cnblogs.com/py1612919884/p/9327015.html
[2] https://www.linuxidc.com/Linux/2019-08/159900.htm
[3] https://www.cnblogs.com/qq78292959/p/3641972.html
[4] https://blog.csdn.net/James_Nan/article/details/99588119
[5] https://blog.csdn.net/lu1024188315/article/details/78710338