LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-23-2004, 01:17 PM   #1
patpawlowski
Member
 
Registered: Mar 2003
Location: Centreville, Virginia
Distribution: Mandrak, Red Hat
Posts: 163

Rep: Reputation: 30
Can't connect to local MySQL server through socket . . .


I have just installed MySQL 4.0 and I can't get the service running. Here's what's happening: I can't connect to mysql because it's not running, I can't start it because mysqld_safe is running and I can't stop mysql_safe. I can't even seem to kill it.

[root@linux init.d]# mysqladmin -u root password treefrog
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

[root@linux init.d]# mysqld start
040123 13:11:49 Can't start server: Bind on TCP/IP port: Address already in use
040123 13:11:49 Do you already have another mysqld server running on port: 3306 ?
040123 13:11:49 Aborting

040123 13:11:49 mysqld: Shutdown Complete

[root@linux init.d]# ps
PID TTY TIME CMD
3992 pts/2 00:00:00 su
3993 pts/2 00:00:00 bash
4354 pts/2 00:00:00 mysqld_safe
4580 pts/2 00:00:00 ps
[root@linux init.d]# mysqld_safe stop
Starting mysqld daemon with databases from /usr/local/mysql/var
040123 13:12:14 mysqld ended

[root@linux init.d]# ps
PID TTY TIME CMD
3992 pts/2 00:00:00 su
3993 pts/2 00:00:00 bash
4354 pts/2 00:00:00 mysqld_safe
4615 pts/2 00:00:00 ps
[root@linux init.d]#
 
Old 01-23-2004, 02:30 PM   #2
sk8guitar
Member
 
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415

Rep: Reputation: 30
do an "updatedb" as root, then "locate mysql.sock" and then make a link from that file to where it should be (i.e. var/lib/whatever). this happened to me before and it turned out that mysql.sock was in some random tmp folder and even if i tried to move it nothing happened. so when i made the link it all worked out fine. maybe i'm not answering the question, but i dunno.
 
Old 01-23-2004, 03:03 PM   #3
asb
Member
 
Registered: Jul 2003
Location: portland
Distribution: debian testing
Posts: 68

Rep: Reputation: 15
I've also had this show up. Don't know what I am doing in mysql, and didn't know how to shut off mysql. Ended up restarting the computer (didn't add mysql to the startup scripts yet). Restarted mysql manually and didn't have any problems. My .sock file was in /tmp, but that is where it was looking for it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 07:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
Can't connect to local MySQL server through socket tommytomato Linux - Newbie 6 05-25-2004 09:16 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration