mysql 问题解决
mysql 出现ERROR 1698(28000): Access denied for user 'root'@'localhost'问题 解决办法如下
sudo gedit /etc/mysql/mysql.conf.d/mysqld.cnf
加入skip-grant-tables
ctrl+s保存,这句话的目的是可以免密码登录
service mysql restart
重启完成后再登录
mysql -uroot -p
在输密码的时候直接回车
use mysql
;
update user set authentication_string
=password
("你的密码") where us
er
="root";
flush
privileges;
select user,plugin
from user;
**如果root的plugin是auth_soket,还需要进行修改 **
update user set authentication_string
=password
("ln122920"),plugin
='m
ysql_native_password' where user='root';
**`quit
List item
`退出数据库之后回到之前的文件处,注释掉之前添加的语句**
sudo gedit /etc/mysql/mysql.conf.d/mysqld.cnf
最后就可以通过设置的密码登录了 参考文章mysql报错问题解答