linux下mysql容许远程链接

1. MySql安装教程

https://dev.mysql.com/doc/refman/5.7/en/linux-installation-yum-repo.htmlhtml

默认状况下mysq的 root用户是不能远程链接的mysql

2. 查看linux防火墙是否开放3306端口

3. 添加防火墙例外

4. 重启防火墙

 

5. 建立远程链接用户并受权

 mysql> select host,user,password from mysql.user;linux

 

建立用户sql

create user test identified by '123456';

受权ide

grant all privileges on *.* to 'test'@'%'identified by '123456' with grant option;
flush privileges;

修改用户密码spa

update mysql.user set password=password('新密码') where User="test" and Host="localhost";

删除用户code

delete from user where User='test' and Host='localhost';
相关文章
相关标签/搜索