Web Hosting Talk







View Full Version : Mysql connect errors


chuckt101
07-29-2002, 09:03 PM
Hey, i'm having a problem with mysql

I'm doing all this from command line! (please don't tell me to get phpmyadmin - i'm doing this to learn)


I can only get into mysql if i'm logged in as root.

[root@asdfadmin]# mysql -u test -p vbull
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 54 to server version: 3.23.22-beta

Type 'help' for help.

mysql> quit
Bye


when i'm another user:

[asdf@asdfadmin]$ mysql -u test -p vbull
Enter password:
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
[asdf@asdfadmin]$



Does anybody know why?!

Noldar
07-29-2002, 09:22 PM
Try this:

ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock

Richard

chuckt101
07-29-2002, 09:29 PM
Originally posted by Noldar
Try this:

ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock

Richard


[root@asdf admin]# ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock
ln: /var/lib/mysql/mysql.sock: File exists
[root@asdf admin]#


so i tried:

[root@asdf admin]# ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock


Still can't connect:
[asdf@asdf admin]$ mysql -u test -p vbull
Enter password:
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
[asdf@asdf admin]$

Noldar
07-29-2002, 09:49 PM
OK. Probably a permissions problem then. Try

chmod 777 /var/lib/mysql/mysql.sock

Richard

chuckt101
07-29-2002, 09:49 PM
nm figured it out :)

the mysql dir (with the mysql.sock connection) was chmod 700 instead of 755 so only root could access it.. :rolleyes:

chuckt101
07-29-2002, 09:51 PM
Originally posted by Noldar
OK. Probably a permissions problem then. Try

chmod 777 /var/lib/mysql/mysql.sock

Richard

hehe.. guess we posted at the same time ;)

thanks anyways!

(i figured it out after carefully reading mysql docs instead of skimming fast like i usually do :) )

Noldar
07-29-2002, 09:52 PM
Hehe...yeah docs are always a 'last resort' :D