Issue
I'm trying to run cake in the command line and I'm getting this error
PDO::__construct(): [2002] Connection refused (trying to connect via tcp://127.0.0.1:3306)
I did some research and it turns out that TCP is not turned on automatically with MAMP.
I looked around to see if I could locate a mysql conf file but I could not.
I am using Mamp 2.1.1 on OSX 10.8.2
Does anyone know what I need to do to enable TCP on MAMP, and how to do it? (I am not using MAMP PRO)
Thanks in advance.
Solution
If you really want to connect over TCP, you need to enable networking in your mysql config file, by removing the skip-networking line.
Instead of enabling networking, if you're only going to talk to mysql on the local machine you can connect over a local socket. In place of the tcp connection, give PDO the socket name, like mysql:unix_socket=/Applications/MAMP/tmp/mysql/mysql.sock
This will work without any changes to MAMP's defaults.
Answered By - whamma
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.