View Full Version : mysql.sock problems - connecting
evil69
Wed 21st Feb '01, 8:11pm
I have all the forum configured and working properly...
the mysql database is setup and running ( i set it up on root on the host, it's all fine )
once I reach step 3 on installation, I recieve a problem about mysql.sock
----------------------------
Attempting to connect...
Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in db_mysql.php on line 31
Warning: Supplied argument is not a valid MySQL-Link resource in db_mysql.php on line 37
----------------------------
Naturally, i goto mysql.sock and retrieve it to see whats wrong and all i get is "Read File Error"
any ideas guys? anything will help, thanks.
I have full access to mysql database along with our hosts who are trying to help us.
*note : hostname = localhost , username = ffstaff *
evil69
Wed 21st Feb '01, 8:38pm
We've reinstalled everything to confirm the problem and yet again mysql.sock failed to create.
it went to it's proper directory, with absolutely nothing in it and "file read error" ....
sigh, what's this caused by? permissions are all set properly.
PeF
Thu 22nd Feb '01, 6:54am
What Linux are you running? MySQL version?
It happened to me when testing RedHat 7.0. After I compiled MySQL I had to "su mysql" and run (can't remember exact command) create_db_tables (or something like that). The point is you have to run it using mysql user not root.
evil69
Thu 22nd Feb '01, 9:50am
It is indeed red hat 7.0
im running it as an mysql user under the name "ffstaff"
mysql is turned on and running but not responding when the scripts attempt to connect through the mysql.sock
im not sure if this is a rare occurence or not, but any help as to how to fix this problem would be appreciated.
Jedi_Luke
Thu 22nd Feb '01, 12:57pm
I am working with Evil69 on this;
I su'd to user 'mysql' and this is eactly what it says:
[root@Matrix-Shells Jedi_Luke]# su mysql
bash-2.04$ sql
bash: sql: command not found
bash-2.04$ mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
bash-2.04$
We are running Red Hat 7 Linux, with MySQL 3.23.22-6. I know their is newer version, but then we would not be able to use the RH7 RPM that allows PHP & MySQL to work together.
When we try to open mysql.sock we recive a file read error. We have tried reinstalling it; and it didn't help at all. Any ideas?
PeF
Thu 22nd Feb '01, 2:05pm
After MySQL anabasis I left RedHat 7.0 (full of holes anyway) and installed 6.2. No probs at all. Latest PHP, MySQL, Apache. Runs like a charm.
You may try http://www.google.com and search for mysql.sock.
jar
Thu 22nd Feb '01, 3:25pm
Originally posted by Jedi_Luke
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
When we try to open mysql.sock we recive a file read error. We have tried reinstalling it; and it didn't help at all. Any ideas? [/B]
I had the same problem running trustix-1.2. My problem seemed to be /var/lib/mysql rights.
Only the mysql user and root had access to the /var/lib/mysql directory and not the httpd process.
I solved my problem by:
chmod o+rx /var/lib/mysql
Hope that helps.
Jedi_Luke
Thu 22nd Feb '01, 5:51pm
I changed the permissions, but it still dosn't seem to be working. I start mySQL by this:
[root@Matrix-Shells /]# /etc/rc.d/init.d/mysqld start
Starting MySQL: [ OK ]
[root@Matrix-Shells /]# ps -aux|grep mysql
mysql 15729 0.0 0.2 2292 1252 pts/9 S 07:47 0:00 bash
root 17445 0.0 0.1 1520 604 pts/9 S 12:38 0:00 grep mysql
[root@Matrix-Shells /]#
however it dosn't seem to running from the looks of that. I then try to see if I can connect to it:
[root@Matrix-Shells /]# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
It is still giving me the same error. How do I replace mysql.sock? Reinstalling mySQL did not replace it; (or if it did, it put a bad copy in).
jar
Fri 23rd Feb '01, 4:31am
Originally posted by Jedi_Luke
[root@Matrix-Shells /]#
however it dosn't seem to running from the looks of that. I then try to see if I can connect to it:
[root@Matrix-Shells /]# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
It is still giving me the same error. How do I replace mysql.sock? Reinstalling mySQL did not replace it; (or if it did, it put a bad copy in). [/B]
/var/lib/mysql/mysql.sock is created by mysql when it is running.
It seems that mysql is'nt running on your system. What does the log say when mysql starts? Check /var/log and /var/lib/mysql/xxx.err
vBulletin® v3.8.0 Beta 4, Copyright ©2000-2008, Jelsoft Enterprises Ltd.