linux下mysql允許遠程連接
阿新 • • 發佈:2018-09-23
遠程連接 pan 修改用戶 all linux下 密碼 刪除 分享圖片 select
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‘;
linux下mysql允許遠程連接