![]() |
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
hi all
i m new to mysql.i m trying to connect mysql from c. i m not running as root. i gave this commands. 1. gcc -c `mysql_config --cflags` sqlex.c 2. gcc -o myclient sqlex.o `mysql_config --libs` above it works fine.its creating myclient executable file.when i try 2 execute myclient,its giving this error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' i dont know what to do? thanks in advance. |
Hello,
The permissions for '/var/lib/mysql/mysql.sock' must be set as follows. srwxrwxrwx 1 mysql mysql 0 Oct 17 00:55 /var/lib/mysql/mysql.sock You need root permission to set this and another option is making a symbolic link to /tmp/mysql.sock |
might be worth noting that you've not even confirmed mysql is running, or even exists.... the fact that you've compiled a client is, in itself, not useful.
|
| All times are GMT -5. The time now is 06:35 AM. |