mysql设置外部访问

1.进入mysql

mysql -uroot -p

2.设置mysql允许外部连接访问(授权):

//授权
grant all privileges on *.* to root@'%' identified by '123456' with grant option;
//刷新
flush privileges;

3.指定ip地址授权:ip地址指的是连接时失败报错1130弹出的地址

grant all privileges on *.* to root@'ip地址' identified by '密码' with grant option;
flush privileges;

你可能感兴趣的:(笔记,数据库)