Thursday, 15 July 2010

connection - IPTables: connexion refused with MySQL (10061) -



connection - IPTables: connexion refused with MySQL (10061) -

before asking i've read first: http://dev.mysql.com/doc/refman/5.0/fr/access-denied.html first try:

~# mysql -h 127.0.0.1 -p 3306 -u uu dbname -p reading table info completion of table , column names can turn off feature quicker startup -a welcome mariadb monitor. commands end ; or \g. mariadb connection id 3296 server version: 5.5.37-mariadb-1~wheezy-log mariadb.org binary distribution copyright (c) 2000, 2014, oracle, monty programme ab , others. type 'help;' or '\h' help. type '\c' clear current input statement. mariadb [dbname]> bye ~# mysql -h 127.0.0.1 -p 3307 -u uu dbname -p error 2003 (hy000): can't connect mysql server on '127.0.0.1' (111)

so it's listening on port 3306. let's see network config:

~# ifconfig eth0 link encap:ethernet hwaddr d4:ae:52:cd:71:d6 inet addr:62.210.129.132 bcast:62.210.129.255 mask:255.255.255.0 blabla ~#

so let's seek right working port not 127.0.0.1:

~# mysql -h 62.210.129.132 -p 3306 -u uu dbname -p error 2003 (hy000): can't connect mysql server on '127.0.0.1' (111)

so i've tried prepare with:

mariadb [dbname]> grant privileges on dbname 'uu'@'62.%' identified 'xx'; query ok, 0 rows affected (0.00 sec) mariadb [dbname]> grant privileges on dbname.* 'uu'@'62.%' identified 'xx'; query ok, 0 rows affected (0.00 sec) mariadb [dbname]> bye ~# mysql -h 62.210.129.132 -u uu dbname -p error 2003 (hy000): can't connect mysql server on '62.210.129.132' (111) ~# ~# mysql -h 127.0.0.1 -u uu dbname -p reading table info completion of table , column names can turn off feature quicker startup -a ... blabla

i've checked table user well:

mariadb [mysql]> select user, host, password user; +------------------+----------------+--------------------+ | user | host | password | +------------------+----------------+--------------------+ | [skipping root ] | | uu | localhost | *c5e430fb96ff191af | | uu | 62.210.129.132 | *c5e430fb96ff191af | | uu | 62.% | *c5e430fb96ff191af | +------------------+----------------+--------------------+ 9 rows in set (0.00 sec) mariadb [mysql]>

so not working. i'm wondering whether comes ip policy or mysql server policy. here's iptables policy:

chain prerouting (policy take 1143 packets, 131k bytes) pkts bytes target prot opt in out source destination chain input (policy take 56 packets, 2938 bytes) pkts bytes target prot opt in out source destination chain output (policy take 236 packets, 17506 bytes) pkts bytes target prot opt in out source destination chain postrouting (policy take 236 packets, 17506 bytes) pkts bytes target prot opt in out source destination chain input (policy drop 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 1 211 take -- * * 0.0.0.0/0 0.0.0.0/0 state related,established 0 0 take tcp -- eth0 * 62.210.129.132 0.0.0.0/0 0 0 take tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 0 0 take tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 0 0 take -- lo * 0.0.0.0/0 0.0.0.0/0 chain forwards (policy drop 0 packets, 0 bytes) pkts bytes target prot opt in out source destination chain output (policy take 3 packets, 852 bytes) pkts bytes target prot opt in out source destination

what missing, should look?

thanks this question, found solution. turned out had comment bind-address directive in my.cnf file:

#bind-address = 127.0.0.1

then works.

mysql connection

No comments:

Post a Comment