debian 安装mysql后远程访问不了

来源:互联网 发布:python标准库是什么 编辑:程序博客网 时间:2024/04/29 04:26

debian 安装mysql后远程访问不了


1. 开启3306端口:iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
2. debian登陆mysql,进入mysql后,更改容许登陆ip地址的范围
mysql> grant all privileges on *.* to 'root'@'%' identified by 'rootpasswd' with grant option;   ##rootpasswd为mysql登陆密码
mysql>flush privileges;
3. /etc/mysql/my.cnf
注释:
bind-address = 127.0.0.1 ###该句表示只允许本机访问mysql
变成:
#bind-address = 127.0.0.1
4. 重启mysql:/etc/init.d/mysql restart
5. 远程登陆成功



0 0
原创粉丝点击