LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-06-2006, 08:15 AM   #1
mimique
LQ Newbie
 
Registered: Apr 2006
Posts: 4

Rep: Reputation: 0
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysq


i got this error message when i start mysql. i just installed SUSE 10 pro and installed apache2 and mysql as package selected installation. whenever i type mysql and hit enter i got this message. im very frustrated, i've been looking around at forums for many hours but cant seem to find an answer. i've tried many methods of solutions from experts but still cant work. this is the exact error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

please help, i need to start on a PHP project soon. thank you in advance to the linux community
 
Old 04-06-2006, 08:43 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
sounds like you've not got mysql running. that's the answer i always give when i answer this question once a week, and i'm normally right
 
Old 04-06-2006, 09:04 AM   #3
mimique
LQ Newbie
 
Registered: Apr 2006
Posts: 4

Original Poster
Rep: Reputation: 0
so bro how would i get mysql or mysqld up and running? really need mysql up and running pretty soon! thanks bro
 
Old 04-06-2006, 09:49 AM   #4
mimique
LQ Newbie
 
Registered: Apr 2006
Posts: 4

Original Poster
Rep: Reputation: 0
i turned off my firewall (just in case it is blocking port 3306) and typed mysqld_safe and it shows this message after i hit enter:

linux:/ # mysqld_safe
Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/lib/mysql/linux.site.pid
060407 10:46:35 mysqld ended

linux:/ #

immediately i see the line "mysqld ended". what do you think is wrong? does it mean the mysql daemon is not started? please help im getting really frustrated!! peace to the OSC...
 
Old 04-06-2006, 10:17 AM   #5
mimique
LQ Newbie
 
Registered: Apr 2006
Posts: 4

Original Poster
Rep: Reputation: 0
another discovery when i run the following command:

linux:/ # mysqld -u mysql
InnoDB: Error: log file /var/lib/mysql/ib_logfile0 is of different size 0 151552 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
060407 11:12:36 [ERROR] Can't init databases
060407 11:12:36 [ERROR] Aborting

060407 11:12:36 [Note] mysqld: Shutdown complete

what does these error messages mean?
 
Old 04-19-2009, 05:33 PM   #6
muro230
LQ Newbie
 
Registered: Apr 2009
Posts: 6

Rep: Reputation: 0
The same problem

I'm having the same problem, did you solve it?

Tk!
 
Old 09-02-2009, 08:39 PM   #7
lamapper
LQ Newbie
 
Registered: Nov 2008
Posts: 8

Rep: Reputation: 2
ERROR 2002 (HY000): Can't connect to local MySQL server... error still alive and well

I too encountered this problem after attempting to reset MySQL's “root” password on my home server.

So sadly this error is alive and well, if people find a solution, they do not seem to come back and report what it was. Makes me wonder if they just gave up. Note a few people gave up on resetting the MySQL “root” password also, stating that only a reinstall of MySQL and MySQL server fixed the problem for them. Chances are they made sure to write down what their new MySQL root password was this time. I will make sure to come back and post a solution when I have one, since no one else has posted anything definitive on this error message that I can find and I have looked on this site, forums and the MySQL home site as well as a few others.

Here is the exact error message I got when I attempt to start the MySQL server from a terminal as root. This is after supposedly resetting MySQL's root password (which I later determined did NOT work)

root@servername:/var/run/mysqld# mysql

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)


Not only did the MySQL 'root' password NOT get reset(not covered here), but I had to shutdown, power off and power on the server in order to get mysql (mysqld) running again.

I was able to get into mysql mode on the server ONLY with

root@servername#mysql -u user

Not that it does you any good as the MySQL 'root' user password has not been changed.

Note: Many people have mentioned potential firewall / router issues as well, so I will bear this in mind, but will look for other solutions before I set up special connections through my firewall / router.
 
Old 09-03-2009, 05:41 AM   #8
lamapper
LQ Newbie
 
Registered: Nov 2008
Posts: 8

Rep: Reputation: 2
This worked for me, hopefully it will for you. Note: I had performed many of the other methods prior to this example. However after rebooting the server, when MySQL came up I was unable to login from another PC via a terminal window and SSH session as any MySQL users other than the default user (mysql -u user). Of course that user is available for everyone by default.

Still this is frustrating when you want to learn more, go in and see as much of the inner workings as you possibly can. The only time I could actually login to the server with any account other than -u user, was when I used the "--skip-grant-tables" option.

For everyone who has been frustrated and unable to get these steps to work here is the URL that finally worked for me, hopefully it will for you as well:

http://codesnippets.joyent.com/posts/show/2038 (this method requires sudo access for one command)

I would try the above FIRST, if it works you are good to go at least I hope you will be.

Note for newbies: The MySQL documentation can be found here: http://dev.mysql.com/doc/refman/4.1/...anagement.html Note: that many of the commands listed here may not work for ubuntu and debian users. Not really sure why, perhaps the commands are geared toward CentOS and Redhat versions of MySQL...? FYI, Here are some examples (see 5.6.2. Adding User Accounts at the mysql.com website):

mysql --user=root mysql does not work on ubuntu (probably not debian either)
mysql --user=root -p does not work on ubuntu
mysql -u root -p does work (on ubuntu) after you successfully reset the password in the step above. This form will prompt you for the password to MySQL's root account.
 
1 members found this post helpful.
Old 09-03-2009, 06:45 AM   #9
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
Not really sure why, perhaps the commands are geared toward CentOS and Redhat versions of MySQL...?
No. The instructions in the reference manual are the instructions for 'standard' installs.
Unfortunately, Ubuntu (and possibly Debian) don't do standard installs.

Other solutions for Ubuntu can be found in post #12 and post #13 on http://ubuntuforums.org/showthread.php?t=27156&page=2

PS I have once tried a Ubuntu server and did not know how fast I had to go back to Slackware.
 
Old 09-03-2009, 07:56 AM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
This error is alive and well becuase it's massively generic, and says so little about which one of the many problems it could acutally be. Please don't drag up dead threads in future.
 
Old 09-15-2009, 07:03 PM   #11
weaponsofwar
LQ Newbie
 
Registered: Aug 2009
Location: no cal
Distribution: openSUSE 10->11.2, fedora 8->11, CentOS 5+, et al
Posts: 6

Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
This error is alive and well becuase it's massively generic, and says so little about which one of the many problems it could acutally be. Please don't drag up dead threads in future.
People are obviously still looking for advice, what harm is it if an old thread gets some new activity?

I've never understood why mods bother saying crap like this...

[that's not an "insult", no ad hominim, just a general observation]

"pantsu misete morotte yoroshiku desu ka?"


http://www.linuxquestions.org/questi...issing-673534/

^ this thread addressed the real issue for me- I've never used mysql just because postgresql is just so awesome I've never had to. but I ran into this when installing from source on Fedora 11.

Last edited by weaponsofwar; 09-28-2009 at 03:50 AM. Reason: new information...
 
Old 09-16-2009, 01:16 AM   #12
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Why becuase someone will start trying to solve the original problem, posed over then 3 years ago, wasting there time for no benefit.

Feel free not to insult mods btw. What interest is it of yours anyway? None of the comments I made related to you personally at all.
 
Old 09-16-2009, 11:58 AM   #13
lamapper
LQ Newbie
 
Registered: Nov 2008
Posts: 8

Rep: Reputation: 2
Quote:
Originally Posted by acid_kewpie View Post
Why becuase someone will start trying to solve the original problem, posed over then 3 years ago, wasting there time for no benefit.

Feel free not to insult mods btw. What interest is it of yours anyway? None of the comments I made related to you personally at all.
Well it does apply to me, as I was the one that drug up the old thread... (no insults were intended than or now)

Obviously I was unable to find a solution and I did search (for multiple hours) for one. No joy. I would not have bothered posting in the first place if I did not search without success first. Just the way I roll.

It is extremely frustrating to search thread after thread after thread, looking for the solution and see so many threads that appear to be related, yet have either no solution or it seems like the person looking gave up. This was my experience while searching for a solution to this particular problem.

Obviously if I found THAT thread, others will too. I too do not see the harm in attempting to post a solution or a link to a solution in order to help others I know will be looking. I know they will be looking because I was looking without success, it is that simple.

A suggestion, instead of stating "Please don't drag up dead threads in future." how about posting the link to one or many of the solutions you know about and the poster obviously does NOT know about. That would be extremely helpful, usually the mod of any forum will know about links that the person looking has no clue about. I love it when someone posts all the related links to possible solutions so I can go through them to see which one applies to my configuration.

One of the biggest problems with all the forums and wikis that I encounter is that the search mechanism does not seem to do an adequate job of bringing up many of the possible related threads, much less all of the threads. My guess is that the framework from which the forum or wiki was built was somehow limiting, thus the search tool does not catch enough, suggest enough or find all the threads that are related to a specific problem. Especially if you do not search on the magic golden hidden un-thought-of, special keyword(s) that will bring up many of those threads. It should be more than dumb luck of selecting the "right" search term.

Given the capabilities of all the SQL platforms today, especially the ability to rapidly search text based content within databases extremely rapidly, why more possible threads are not captured in any search is beyond me. I know its not the database engine limiting this, yet I did not see all the solutions you have alluded to?

Based on your response about not digging up old threads, I would not be surprised if a forum or wiki did not search "deep" enough through the threads in order to prevent dragging up a post considered too old. That would be sad if that 'old' post had the solution in it, wouldn't it.

And if someone sees a thread without a solution, I definitely do not see the harm in trying to provide one. How can that be construed as anything but helpful to everyone? I have never gotten that either. I don't give a rat's how old a thread is, I am only interested in a solution to the problem. If that comes from an 'old' thread GREAT.

I wish everyone that posted a problem would come back on line and post their solution, a link to the solution, what not to do, something, anything, however we all know that does not always happen. It did not happen in this case either, no surprise there.

What is insulting and more frustrating is when a thread is closed without a solution or link to the solution. How can a problem ever be closed without offering a solution. How does that make any sense? Even if the solution to the problem is that there is not a solution. I am not saying that I have encountered that here, just a thought that entered my mind as I wrote this. I know I have seen this on other forums and wikis on the net in the past.
 
1 members found this post helpful.
Old 09-17-2009, 12:50 PM   #14
weaponsofwar
LQ Newbie
 
Registered: Aug 2009
Location: no cal
Distribution: openSUSE 10->11.2, fedora 8->11, CentOS 5+, et al
Posts: 6

Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
Why becuase someone will start trying to solve the original problem, posed over then 3 years ago, wasting there time for no benefit.

Feel free not to insult mods btw. What interest is it of yours anyway? None of the comments I made related to you personally at all.
@acid_kewpie

this information is still relevant - some of the routines in the current mysql source date back to 2003 - that means that people could be experiencing bugs that have some history behind them.

You shouldn't be a mod If you took any offense at that at all. I didn't insult you. I just thought you posted a useless reply, are there any other more temperate mods on here I can report you to?

also I'm assuming you have some expertise on this subject - do you have any suggestions on where to start looking for some answers for this dilemna? the idea behind forums being to *help* people.

@lamapper

I found this which seems to lead in the right direction.

http://www.webyog.com/forums//index.php?showtopic=1367


good luck
 
Old 09-17-2009, 01:20 PM   #15
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
@lamapper
It's often better to start a new thread than to call up an old one. Just indicate that you did search and what did not seem to apply. I agree that it's frustrating to go through a big number of threads without finding the answer, but that's the disadvantage of so much info available.

@weaponsofwar
Let's start that lamapper already seemed to have found his solution (see post #8).

Quote:
I've never understood why mods bother saying crap like this...
That is what offended acid_kewpie and it would have offended me as well.

And the way you wrote your last post, you very subtle keep on insulting acid_kewpie; at least that is how I read it.

And please try not to bother other users with conflicts between yourself and mods; you should be able to contact mods directly via a private message.
If you don't come right, you can contact jeremy.

PS
you've done it, I did not want to get involved but now I am

Last edited by Wim Sturkenboom; 09-17-2009 at 01:24 PM. Reason: added PS
 
  


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: Can't connect to local MySQL server through socket J0sep Red Hat 20 07-13-2011 09:32 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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:13 PM.

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