How to fix MySQL issue
I had changed MySQL home directory path from /var/lib/MySQL to /data/MySQL
I had taken foll steps stopped mysql cp -rap /var/lib/MySQL /data/mysql it copied successfully I changed data dir path in vi/etc/my.cnf file to /data/mysql and also changed MySQL.sock file path to new path /data/MySQL restarted the MySQL server I now am trying to login into MySQL server using MySQL -u root -p after entering the password I gets error ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) if I give the old path of data and socket file it works but new path not working please help ? |
If you change the socket in my.cnf you will need to have a corresponding [client] entry to tell the mysql client to use this socket.
Try adding this to the end of your my.cnf once you've made your changes: Code:
[client] |
Also make sure you changed ownership of /data/MySQL to the mysql user
edit: it's /data/mysql or /data/MySQL ? |
All times are GMT -5. The time now is 10:44 PM. |