红联Linux门户
Linux帮助

Linux下安装了MySQL之后,无法用navicat连接数据库?

发布时间:2016-04-02 08:39:28来源:linux网站作者:laughing_cui

1、首先使用如下指令进入到MySQL数据库
mysql -uroot -p密码   
进入到数据库之后,执行如何指令:
grant all on *.* to 'root'@'%' identified by 'yourpassword';
grant all on *.* to 'root'@'localhost' identified by 'yourpassword';(root为用户名)


2、在Linux终端里运行以下命令:
iptables -X
iptables -F
作用:清除iptables


3、执行如下命令,查看MySQL监听的地址
ss -tnlup
然后把/etc/mysql/my.cnf中的内容添加如下两句:
[mysqld]
bind-address=0.0.0.0  //这样表示可以监听所有的地址


4、重启数据库  
service mysql restart


本文永久更新地址:http://www.linuxdiyf.com/linux/19451.html