Symptoms:
- I am running CentOS 6.
- I can connect to the remote MySQL from the command line:
mysql -h a.b.c.d -u user -p -D db
. - Laravel artisan commands run on the local command line can also connect:
artisan migrate
. - But the same Laravel code when running through Apache cannot connect.
- The error is:
SQLSTATE[HY000] [2003] Can’t connect to MySQL server on ‘a.b.c.d’ (13)
- The MySQL help on reasons for "access denied" didn't help.
What am I doing wrong? (I am self answering for posterity.)