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

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

时间:2018-02-09 23:59:19      阅读:335      评论:0      收藏:0      [点我收藏+]

标签:table   刷新   mysql数据库   this   reading   oracle   may   sql数据库   mat   

远程无法连接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)

标签:table   刷新   mysql数据库   this   reading   oracle   may   sql数据库   mat   

原文地址:https://www.cnblogs.com/sandyyeh/p/8437034.html

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