NOTE: The following is intended for all you PHP/MySQL developers out there who use Dreamweaver on your Mac and either have or intend to upgrade to Leopard. While the new 10.5 OS has a lot of great PLUSES – I’ve been hacking through a few head-scratchers but things are coming together and my work environment is close to being restored (last task is checking my Ruby development server).
When trying to test/work on some PHP/MySQL connections in Dreamweaver MX 2004, the connection to my MySQL database was broken and kicking up a MySQL #2002 error. I found the following how-to on a MySQL support site that was offered by a commenter. I tried it and voila! – things are now working perfectly. Please note – this works for MX 2004 and the one who offered this solution does not guarantee that the fix works for any other versions although I suspect that might be the case.
Here you go:
*Attention Dreamweaver Users*
When attempting to connect to a database in Dreamweaver you will get an error message like:
“Connection failed reason unknown” or “Could not connect to ‘/var/mysql/mysql.sock’”
This is because, as listed above:
“The MySQL socket file is created as /tmp/mysql.sock by default.”
To fix this you will need to create a new folder on your desktop named “mysql” (minus quotes). Then open a terminal. Change directory to “var” by typing “cd /var”. Once in that directory type: “sudo mv /Users/<your user name here>/Desktop/mysql/ mysql”
You will be prompted for your password. After entering your password you will see the folder dissappear from your desktop. If you type “ls” at the prompt it should now be listed in the “var” directory. Since copying of sockets is not allowed the mysql.sock file located in the “tmp” directory will have to be moved.
So change your directory to “/var/mysql” which you just created. Then at the prompt type:
“sudo mv /tmp/mysql.sock mysql.sock”This should move “mysql.sock” to “/var/mysql” and you can once again check by typing “ls”.
Now, when you go back to Dreamweaver and hit that select button to find your database, it should pop right up!
Just don’t forget to tell your other MySQL helper apps like MySQL Administrator where the new socket is.This is only a temporary fix and will have to be done again if the server is stopped.
I hope this is useful info. BTW the version of Dreamweaver this tip is intended for is MX. I have no idea if this is a problem for newer versions.
Lee Woodrough
Blogged with Flock
Tags: php, mysql, dreamweaver, leopard, 2002
| 2.5 |
jonh