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