$mysql -u roboo -h 172.16.100.30 -p
error showed as following:
Enter password:
ERROR 2003 (HY000): Can't connect to MySQL server on '172.16.100.30' (111)
i googled around, someone said can edit the my.cnf , comment this line:
skip-networking
but there isn't any my.cnf on the file system. even type locate my.cnf,nothing
happened, i got stuck on the problem. then tried to find which configuration
file (my-huge.cnf, my-large.cnf, my-medium.cnf, my-small.cnf ?) mysql is
using, and didn't find anything in /usr/bin/mysqld-safe. however, find
something useful by ps command:
$ps aux|grep mysql
root 3896 0.0 0.0 2328 432 ? S 08:56
0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid --skip-networking
mysql 3921 0.0 0.5 52840 5416 ? S 08:56
0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking --skip-networking
mysql 3922 0.0 0.5 52840 5416 ? S 08:56
0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking --skip-networking
mysql 3923 0.0 0.5 52840 5416 ? S 08:56
0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking --skip-networking
.....
yes,--skip-networking is the key.it means when mysqld is started,
a "--skip-networking" parameter is passed. I opened /etc/rc.d/rc.mysqld ,
and see this line:
SKIP="--skip-networking"
and in the later lines SKIP is taken as a parameter of mysqld. so comment the
SKIP line, restart mysqld.
#/etc/rc.d/rc.mysqld restart
it works!