linux下mysql允許遠程連接


1. MySql安裝教程

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

默認情況下mysq的 root用戶是不能遠程連接的

2. 查看linux防火牆是否開放3306端口

3. 添加防火牆例外

4. 重啟防火牆

 

5. 創建遠程連接用戶並授權

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

 

創建用戶

create user test identified by '123456';

授權

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

修改用戶密碼

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

刪除用戶

delete from user where User='test' and Host='localhost';

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM