Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error 2002: Can't connect to local MySQL Server through socket.... 2

Status
Not open for further replies.

desiboyz

ISP
Aug 2, 1999
1
US
Hello,<br>
<br>
I have installed mysql on linux (RH6.0) using the 3 rpms (server,client,develop). When I run the command "mysql", I get the following error "Error 2002: Can't connect to local mysql server through socket '/var/lib/mysql/mysql.sock' (111)". Please help.<br>
<br>
Thanks,<br>
Ken.
 
I am having the same problem on RH6.0.<br>
If anyone has this and knows a solution, you would save us <br>
some valuable time. Thanks!
 
Found the problem. It seems another program was holding the Apache port (3306 I think) hostage so mySql couldn't establish a connection. I uninstalled the offending program and viola.<br>
<br>
Hope this helps someone else.<br>
<br>
Thanks anyway,<br>
iRez
 
Did you find any solution to this problem. I am facing he same problem after a reboot.<br><br>Thanks
 
Try running mysql_install_db.<br><br>Usually located at /usr/local/bin/mysql_install_db<br>cd to that directory, then run ./mysql_install_db<br>then, mysqladmin -u root password newpassword<br>(the default root password is &quot;password&quot;, so change it)<br><br>Connect with:&nbsp;&nbsp;mysql -u root -p<br>or<br><br>mysql -u root -h localhost -p<br>(you will be prompted for password)
 
There is a good possibility that you set the permissions on your DATADIR to restrictive.<br>The DATADIR on my RedHat 6.0 is /var/lib/mysql<br><br>Try this: chmod 755 /var/lib/mysql<br><br><br>good luck,<br><br>Richard
 
Try this: chmod 755 /var/lib/mysql

I think Richard's solution will work for most of you. If you can connect as root but not as another user, this will work.

-Brian
 
I'm having the same problem on a DEC Alpha machine running DEC UNIX (Tru64) 5.1. I start the service. It appears to be running (using ps). It does not create a mysql.sock (socket) file in the directory specified in /etc/my.cnf.

When installing the binary, '/mysql_install_db' just hangs when it gets to the place where it runs mysqld. I've tried 3.23.33-dec-osf5.1 & 3.23.38-dec-osf5.1 distributions.

I've tried specifying different locations for the socket. (All tried directories were writable by anyone.)

Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top