mysql 1045 - Access denied for user 'root'@'*.*.*.*' (using password YES)

Posted 江南叶少

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql 1045 - Access denied for user 'root'@'*.*.*.*' (using password YES)相关的知识,希望对你有一定的参考价值。

远程无法连接mysql 

解决方法:

  1、在服务器登录数据

mysql -uroot -hlocalhost -P3306 -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.6.39 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type help; or \h for help. Type \c to clear the current input statement.

 

  2、选择mysql数据库

mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

  3、更新root密码

mysql> UPDATE user SET Password=PASSWORD(‘newpassword‘) where USER=‘root‘;
Query OK, 4 rows affected (0.01 sec)
Rows matched: 5  Changed: 4  Warnings: 0

  4、刷新权限

mysql> FLUSH PRIVILEGES; 
Query OK, 0 rows affected (0.00 sec)

 



以上是关于mysql 1045 - Access denied for user 'root'@'*.*.*.*' (using password YES)的主要内容,如果未能解决你的问题,请参考以下文章

mysql ERROR 1045 (28000): Access denied for user 可能解决方法分析

mac安装mysql报错ERROR 1045 (28000): Access denied for.

MySQL ERROR 1045 (28000): Access denied for user 'bill'@'localhost' (使用密码: YES)

MySQL ERROR 1045 (28000): Access denied for user 'bill'@'localhost' (使用密码: YES)

MySQL ERROR 1045 (28000): Access denied for user 'bill'@'localhost' (使用密码: YES)

MySQL ERROR 1045 (28000): Access denied for user 'bill'@'localhost' (使用密码: YES)