ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2)

Installed mysql 4 from dmg ackage, 64 bit.
started mysqld from preferences, but when trying to connect received this error:

MyCOmp~ # mysql5 -uroot
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (38)

The issue? well, few things:

1) make sure the /opt/local/var/run/mysql5/ directory does exist.
2) make sure proper permission, for write purpose for mysql user: sudo chown mysql:admin /opt/local/var/run/mysql5/
3) create and softlink it to proper places. which in my case, i took example of my.cnf from /opt/local/share/mysql5/mysql/my-small.cnf then after renaming it to /opt/local/etc/mysql/my.cnf. i then softlink this to /etc/mysql/my.cnf. Note that you might need to create the directory /etc/mysql

And then it works like a charm. :)

/alak

Comments

Popular posts from this blog

SAP: Segregate Different SMTP Mail Server Based on Sender Domain

SAP Client Copy Error: Errors occurred during export of container object FINB-TR-DERIVATION

Quick Dirty Script for Checking Oracle Data Gurad Gap and Emailing it