[mysqld]
skip-grant-tables=1
$ sudo service mysql stop
$ sudo service mysql strat
$ mysql
//修改验证方式
mysql> USE mysql;
mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';
//修改密码
mysql> update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';
//刷新权限
mysql> flush privileges;
//推出
musql> exit;
$ mysql -uroot -p
https://stackoverflow.com/questions/39281594/error-1698-28000-access-denied-for-user-rootlocalhost#
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。