LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Can't connect to local MySQL server through /mysql.sock (https://www.linuxquestions.org/questions/linux-software-2/cant-connect-to-local-mysql-server-through-mysql-sock-452718/)

ganesh343 06-08-2006 05:51 AM

Can't connect to local MySQL server through /mysql.sock
 
How can I fix this prblem??

ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
-Ganesh

DrOzz 06-08-2006 06:59 AM

is the mysqld process running ? Check this first by typing :
Code:

ps aux | grep mysqld

ganesh343 06-08-2006 11:39 PM

[root@enter3 root]# ps aux | grep mysqld
mysql 5220 0.0 0.2 12808 1496 ? S Jun08 0:00 /usr/sbin/mysqld
mysql 5222 0.0 0.2 12808 1496 ? S Jun08 0:00 /usr/sbin/mysqld
mysql 5223 0.0 0.2 12808 1496 ? S Jun08 0:00 /usr/sbin/mysqld
root 9389 0.0 0.1 1732 596 pts/0 S 10:08 0:00 grep mysqld
[root@enter3 root]#

ganesh343 06-08-2006 11:41 PM

I changed the 'datadir' on file /etc/my.cnf file.

then I started it with 'mysqld_safe'

Now its running on its own.
I dont know what happend.
- Ganesh

ganesh343 06-08-2006 11:45 PM

Anyway who ever is having problem with mysql.sock

Make sure the mysql base directory and mysql data directory should have the proper permissions.
- chown mysql.mysql <folder>
Forget about the creation of mysql.sock on your own. On mysql startup it creates this file.

So the error

ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

is only because of permissions problem.
-Ganesh

DrOzz 06-09-2006 10:39 AM

Quote:

is only because of permissions problem.
not only ;) that was the point of my first question, cause it can also be the same error when the process isn't running

Ever hear of that saying, start with the easiest things first :D

spooge 03-14-2007 06:57 PM

a lil late for this thread, but i ran into the same problem.
everything was running fine and the mysql error popped up.

i mdified my my.cnf
Code:

skip-innodb
and this did the trick.

forgot where i found this :confused:

litespeeder 07-13-2009 10:05 AM

create the mysql.sock with the following command
 
mysql -uroot -p -socket=/dbadmin/mysql/mysql01/run/mysql.sock


All times are GMT -5. The time now is 02:58 AM.