当前位置:Gxlcms > mysql > mysql远程访问被拒绝问题_MySQL

mysql远程访问被拒绝问题_MySQL

时间:2021-07-01 10:21:17 帮助过:48人阅读

bitsCN.com

远程连接MySql数据库时:

  ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

远程连接被拒绝;

解决方法:

MySQL> use MySQL;
Database changed
MySQL> grant all privileges on *.* to ‘yourUser’@'%' identified by ‘yourPassword’;
Query OK, 0 rows affected (0.00 sec)
*.*标示所有数据库下的所有表,’*’.*标示数据库*下的所有表
MySQL> grant all on *.* to ‘yourUser’@'%' identified by ‘yourPassword’;
Query OK, 0 rows affected (0.00 sec)
%号出可以填写允许访问的IP地址或者主机名,%标示所有的IP
Flush privileges;
Query OK, 0 rows affected (0.00 sec)
Mysql> exit;

bitsCN.com

人气教程排行