码迷,mamicode.com
首页 > 数据库 > 详细

MySQL问题:Access denied for user 'mysql'@'localhost'

时间:2018-12-16 23:15:36      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:div   localhost   bsp   host   ring   mys   tar   password   user   

deep@deep-PC:~$ sudo mysql -uroot -p

mysql> update mysql.user set authentication_string=PASSWORD(mysql), plugin=mysql_native_password where user=root;
Query OK, 1 row affected, 1 warning (0.04 sec)
Rows matched: 1  Changed: 1  Warnings: 1

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
deep@deep-PC:~$ sudo service mysql restart

 deep@deep-PC:~$ mysql -uroot -p

 

MySQL问题:Access denied for user 'mysql'@'localhost'

标签:div   localhost   bsp   host   ring   mys   tar   password   user   

原文地址:https://www.cnblogs.com/mzfly/p/10127987.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!