mysql 用localhost能登录:ip不能登录,他人无法用ip连接

mysql 用localhost能登录:ip不能登录 :
执行下面程序,参数自换:
这里写图片描述

grant all privileges on *.* to '用户名'@'你本机ip' identified by '密码';

mysql 他人无法用ip连接:
在mysql执行如下代码,参数自换

GRANT ALL PRIVILEGES ON *.* TO '用户名'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
FLUSH PRIVILEGES;

猜你喜欢

转载自blog.csdn.net/qq_25384901/article/details/78521658