简体   繁体   中英

Mysql not generating log when connection fails

I am continuously getting below error while connecting to mysql-

Can\'t connect to MySQL server on /ip/address

but mysql is not generating any log for this error. I have below entries in my.cnf file

log=/var/log/mysql_err.log
log-error=/var/log/mysql/mysql_error.log

I am using correct credentials. No issue of conections. Now how will I determine the exact issue If I'll not get any log ? Any Idea, how to solve this ?

This is not surprising:

the server can only log an incident it is aware of. However your client does not even reach the server at all! So how should the server know some client has attempted to contact it?

The error message you get clearly indicates that you do have a connection issue. You can easily make a test to check the most common problems: just open a telnet connection from the system trying to connect to the system the sql server runs on, connect to the mysql port: telnet <ip-of-mysql-server> mysql

On typical unixoid systems "mysql" will be substituted by the "well known port number of mysql, which is 3306. otherwise you have to specify it manually. Do you get a connection at all? I would guess not. This means either the mysql server is not listening where expected (not running or configured otherwise) or the connection is blocked on network level (firewall).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM