0

I have servers :

  • a Sql server
  • a VPS

I installed apache on my debian server. I want to access my SQL server through PDO. But an error occurs :

SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'my_sql_server_ip' (110)'

However, I can access my SQL server from local apache server (MAMP). So I think the problem is client side.

Any suggestion ?

ThBM
  • 71
  • 5
  • possible duplicate of [ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)](http://stackoverflow.com/questions/1673530/error-2003-hy000-cant-connect-to-mysql-server-on-127-0-0-1-111) – Kevin Brown-Silva Jan 19 '15 at 16:55

1 Answers1

0

On MAMP , click File Menu > Edit Template > MySQL my.cnf

and change bind-address = 127.0.0.1 by bind-address = 0.0.0.0

(don't edit directly /Applications/MAMP/tmp/mysql/my.cnf because MAMP will overwrite the file on restart)

Gerard Rozsavolgyi
  • 4,834
  • 4
  • 32
  • 39