Can't connect to MySQL after changing data and socket dirs
Hello
Centos 6, mysql 5.1.52-1.el6_0.1 I wanted to change my datadir from /var/lib/mysql to /home/mysql as well as to put socket file to /var/run/mysqld Here my configs and error where should i change path else to get it working ? Code:
# mysql -u root -p Code:
# netstat -tulpn | grep mysql* Code:
[mysqld] Code:
get_mysql_option mysqld datadir "/home/mysql" Yes i have restarted service as well as whole machine. Why does it still trying to read sock file in old location ? Where should i change this setting ? |
Solved.
Had to change client part of mysql as well. Code:
[client] |
Quote:
|
After that for proper work of PHP with mysql mysqli you have to change some strings in php.ini:
Code:
mysql.default_socket = Quote:
|
Could I hire you to fix my error?
"ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)" |
Hi, just wanna share, today I fixed the problem with this error message : "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)"
the problem was with the permission of mysql user , the new datadir path I set is /new/data first I only set the permission to the designated folder only : chown mysql:mysql /new/data, then error occurred. I fixed the issue by set the correct user (mysql) to the folder /new , I set chown mysql:mysql /new, please try. Thanks |
Encountered this while setting up percona cluster
Hi,
I encountered this while setting up percona 5.7 cluster. So after updating mysqld.cnf, client section issue was not fixed. Ultimately it resolved after updating mysqld_safe.cnf file with new socket path. Thanks, |
All times are GMT -5. The time now is 04:57 PM. |