mysql 遇到问题及解决方案

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_35781178/article/details/82252564

用localhost 和127.0.0.1可以连接数据库,用IP不可以连接[MySQL数据库版本:5.7.20]:

原因:

MySQL 默认是没有开启这个权限的(只允许使用 host:localhost或者 host:127.0.0.1),如果想用host:192.168.1.* ,来访问MySQL,需要手动开启这个权限。
cmd---cd C:\tools\mysqlServer\mysql-5.6.24-winx64\bin---mysql -u root -p---输入密码[root]---

grant all privileges on *.* to 'root'@'192.168.3.228' identified by 'root';

grant all privileges on *.* to 'root'@'%' identified by 'root';
---Query OK, 0 rows affected (0.03 sec) [成功]

flush privileges;

猜你喜欢

转载自blog.csdn.net/qq_35781178/article/details/82252564