Tuesday, March 14, 2017

MySQL can connect to remote through command line, but Laravel fails

I have configured remote MySQL to connect to one database from another server. When I run MySQL from the command line, it works seamlessly:

mysql -u username -p -h 123.12.12.456

This gets me right into the remote server. But when I configure the same DB connection in Laravel, I get

Illuminate\Database\QueryException with message 'SQLSTATE[HY000] [2002] Connection refused (SQL: select * from table)



via Jeff

Advertisement