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';
相關文章
相關標籤/搜索