mysql

xiaoxiao2021-02-28  22

1). 没有授予相应的权限:

mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION; FLUSH PRIVILEGES

3). 防火墙禁止了3306端口,以iptable为例 

vi /etc/sysconfig/iptables     增加下面一行:     -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306-j ACCEPT     service iptables restart     ps: iptables设置     1) 重启后生效     开启: chkconfig iptables on     关闭: chkconfig iptables off     2) 即时生效,重启后失效     开启: service iptables start     关闭: service iptables stop

4). 修改MySQL的配置文件/etc/mysql/my.cnf,因为默认3306端口只允许本地访问的,注释掉这行

  #bind-address = 127.0.0.1   然后重启Mysql,/etc/init.d/mysql restart
转载请注明原文地址: https://www.6miu.com/read-1650234.html

最新回复(0)