can not connect to mysql by external network ip -


i'm using centos 6.5 64bit , mysql-server-5.5.43-29.el6.art.x86_64 external network ip address 118.192.87.188

first:

vim /etc/sysconfig/iptables -a input -m state --state new -m tcp -p tcp --dport 3306 -j accept :wq 

second:

yum -y install mysql mysql-server /etc/init.d/mysqld start chkconfig mysqld on cp /usr/share/mysql/my-medium.cnf /etc/my.cnf 

third:

mysql_secure_installation     ....... "thanks using mysql!" 

forth:

/etc/init.d/mysqld restart 

fifth:

mysql -uroot -ppasswd -p3306 mysql>use mysql; mysql>select user,host user; mysql>update user set host='%' user='root'; mysql>grant privileges on *.* 'root'@'%' identified 'passwd' grant option; mysql>flush privileges; 

question: can connect mysql in centos using:

mysql -uroot -ppasswd -p3306 mysql -uroot -ppasswd -hlocalhost -p3306 mysql -uroot -ppasswd -h127.0.0.1 -p3306 mysql -uroot -ppasswd -h118.192.87.188 -p3306 

but in ubuntu:

mysql -uroot -ppasswd -h118.192.87.188 -p3306 

30 seconds later:

error 2003 (hy000): can't connect mysql server on '118.192.87.188' (110)


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -