当前位置:   article > 正文

Access denied for user ‘root‘@‘localhost‘ (using password: YES)

Access denied for user ‘root‘@‘localhost‘ (using password: YES)

ubuntu  mysql密码不对

sudo gedit /etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld]

下一行添加用来跳过密码验证

skip-grant-tables

重启mysql

/etc/init.d/mysql restart

然后终端输入mysql

mysql> use mysql;
mysql>update mysql.user set authentication_string=password('123456') where user='root';
mysql> flush privileges;
mysql> quit

此时新密码为123456

然后再去/etc/mysql/mysql.conf.d/mysqld.cnf

去掉skip-grant-tables

然后输入

mysql -u root -p

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/运维做开发/article/detail/944378
推荐阅读
相关标签
  

闽ICP备14008679号