visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

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


By: teustace U.S.A.  Date: 09/05/2003 00:00:00  English French  Points: 300 Status: Answered
Quality : Excellent
Dear Someone, Urgent help!

I have had this error message come up all day and night and I'm at my wits end. I have trawled the web and it seems alot of other people have had the same problem but I still haven't been able to fix it.

I have recently installed Redhat8 with MySQL. I realise MySQL server is not running but I don't know what to do. I can run the mysql_install_db but that is all. I set a group called mysql and user as mysql. I have tried to create a mysql.sock by the touch command to the tmp directory.

I am only using the database for a PHP website for a school assignment so I'm not too bothered about security. I have allocated alot of points to someone who can kindly help me to get this damn thing solved so I can move off groundlevel. I'll give half the points if I'm not successful but realise I'm really useless.

Yours gratefully Teddy Useless

MySQL ERROR 2002 Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock (111)
By: campbe79 Date: 09/05/2003 02:44:00 English  Type : Comment
From the mysql installation directory, try running the following command:

./bin/safe-mysqld
By: teustace Date: 09/05/2003 15:07:00 English  Type : Comment
Thankyou for responding.

I have done as you suggest. It runs then says 'mysql ended'
If Ithen type in shell> mysql I get the same ERROR 2002 message

Regards Teddy
By: VGR Date: 10/05/2003 05:50:00 English  Type : Comment
evident : the mysqld daemon isn't running, it failed to run

that msg is very clear and comes from the client (mysql), not from the server

look in my.err or "messages" or start mysqld manually

chances are it's a "simple" access rights problem over %datadir% from unix user "mysql" (datadir is specified in my.ini or my.cnf)

check also that you've only ONE file my.ini or my.cnf
By: teustace Date: 10/05/2003 19:02:00 English  Type : Comment
Hello VGR I've seen your name about! You have helped alot of people!

My host name is summertime. I do not have a summertime err. file.
How do you start MySQL manually?

I have a folder called data, in path /usr/local/mysql. If this is the datadir you are talking about the permissions are set as:
File Owner: Mysql - Mysql Server
File Group: Mysql
drwxrwx

What is my.ini or my.cnf ?
I do have two php.ini files somehow, has these got anything to do with this?
By: VGR Date: 10/05/2003 19:15:00 English  Type : Comment
0) hello :D

1) "my.err" is the standard error file of MySql. The cause of the error (the server fails to start, remember?) is in there. Do "find / -name my.err"

2) the /usr/local/mysql/data directory should read :
datadir=/usr/local/mysql/data
or
datadir=./data
in the config file my.ini or my.cnf

3) absolutely search and find my.ini or my.cnf on your filesystem, it's an essential file. Use "find" as above.

4) permissions seem to be 770 which isn't that bad (it's good, in fact :D )

5) non, php.ini isn't linked to the problem (yet :D ) but hacing two of them in your path may lead to hair-pulling-sessions. Rename one of the two and work only in the other one ;-)
By: teustace Date: 10/05/2003 20:27:00 English French  Type : Comment
Addressing your points by number is a good idea!

1) my.err - still cannot find this. Is "my" a file name or is it supposed to mean something I have named? When you say - Do "find / -name my.err" - what do you mean by - /-name -? Any way, I have looked manually through everything and have not found like these files, except in a directory called - support files - I have my-huge.cnf my-large.cnf my-medium.cnf and my-small.cnf.

2) I don't understand what I should do with your point 2) In the data directoty I have two directories, mysql and test. Both are empty. However, I do have two mysql_config files. One is in /usr/bin the other is in /usr/local/mysql/bin

3) I'm tempted to throw all the files away and start again.

Merci beaucoup pour votre assistance :-)

By: VGR Date: 10/05/2003 20:40:00 French English  Type : Answer
3)ce n'est pas une mauvaise idée

1) ok, that's possible after all if no errors occur in MySql :D

2) one of the my.cnf* files should be renames my.cnf accordingly to README of MySql installation; RTFM ;-)

I think you misinstalled the whole stuff.

BTW, the datadir/mysql shouldn't be empty. It should contain the "system" tables of the server, created after doing install_db or the like (again, this is in the installation procedure)

PS when I say

Do "find / -name my.err"

don't ask yourself questions and type the command :
find / -name my.err <ENTER>

;-)

By: teustace Date: 10/05/2003 20:58:00 English  Type : Comment
3) OK I'm going to reinstall it and start again. I'll keep you posted because I have run out of faith anything will work ever again!
By: teustace Date: 10/05/2003 23:36:00 English  Type : Comment
If you are still around....:-)

I have installed a binary distribution. When I issue this command: - ./bin/safe_mysqld --user=mysql & - it replies: - starting mysql daemon with databases from /var/lib/mysql 030510 23 :35 : 57 mysql ended

I then do a test to see if mysql is running: - /usr/local/mysql/bin/mysqladmin ping
and it replies: - connect to server at 'localhost'failed error: 'can't connect to local MySQL server through socket '/tmp/mysql.sock

I have a mysql.sock in the tmp file now but I don't think its looks right because the size of it is 0 bytes.

Again I don't have anything in the /usr/local/mysql/data directory
I don't have anything in /usr/local/libexec directory
I dont have a /usr/local/var directory

Yours in anticipation, Teddy
By: VGR Date: 10/05/2003 23:36:00 English  Type : Comment
stop ! ;-)

1) never create/touch a file named mysql.sock ! this is created by the server for clients to comlmunicate with it, and yes, it's size seems to be zero.

2) do a "ps -aux | grep sql" : do you see 'mysqld' ? (or 'safe_mysql')

3) are there databases ('test' and 'mysql') in directory /var/lib/mysql ? What are the access rights to this directory ?

mysql_install_db hasn't been properly run. Even a binary distribution needs some configurztion steps to be undertaken.

Please read at <A HREF="http://www.mysql.com/doc/en/Linux-RPM.html">http://www.mysql.com/doc/en/Linux-RPM.html</a>

then <A HREF="http://www.mysql.com/doc/en/Installing_binary.html">http://www.mysql.com/doc/en/Installing_binary.html</a>
By: psadac Date: 11/05/2003 23:52:00 English  Type : Comment
just a litte add-on to VGR comments :

have you installed the rpm package ?

rpm -qa|grep mysql

try to start mysql daemon using :

/etc/init.d/mysql start

or

/etc/init.d/mysqld start

(sorry i don't use redhat).
By: teustace Date: 12/05/2003 00:33:00 English French  Type : Comment
Hello!
Je suis tres content!. I went to mysql.com and downloaded the lastest version 4.0.12. I have all the files I'm suposed to have and it works fine!

I have to say at this point, to anyone having similar troubles, dont put too much faith in CD's that come with books. I spent three weeks trying to load Redhat8 to realise that the disc had dropped off vital files. This has also happened with MySQL. I had two different copies of the program on CD, I guess I should have learned!

Thanks VGR for putting me on track because I would never have known the files that I needed to know that they were missing, without your help. You have been very persistent, merci beaucoup.
By: VGR Date: 12/05/2003 01:27:00 English  Type : Comment
you're welcome

it's really the stupidest thing to do, to deliver incomplete packages ; halas it happens

beware that Mysql 4.0.12 is beta imho and is not "the latest" : it's the latest, right, but version 4 ! it's in fact the first "right" release of the NEW version

if i were you, i would for the moment have sticked with 3.23.57
By: teustace Date: 12/05/2003 02:15:00 English  Type : Comment
According to their website MySQL Version 4.0.12 was declared stable for production use in March 2003.(For more info <A HREF="http://www.mysql.com/press/release_2003_10.html">http://www.mysql.com/press/release_2003_10.html</a>)

I will keep in mind what you have said but I haven't time to mess about, if I run into trouble I'll download the older version. Trouble is it took two hours to download version 4.0.12 plus messing about afterward!
By: VGR Date: 12/05/2003 02:45:00 English  Type : Comment
strange ;-)

I installed in a matter of minutes 8-)

I suppose it depends on the form you use (MSI, RPM, EXE, TGZ...)
By: teustace Date: 12/05/2003 02:56:00 English  Type : Comment
No, its a slow connection through our service provider Telstra. We don't have broadband, we tourniquet :-)
By: VGR Date: 12/05/2003 05:09:00 English French  Type : Comment
tourniquet ?
token ring ? :D

telstra ? Hummm which country is this ? :D

Austria !

et ca parle francais la-bas ? hu hu hu encore un expatrié 8-)
By: VGR Date: 12/05/2003 05:11:00 English  Type : Comment
Their site is done in JSP + ColdFusion : I'm not surprised the ISP is slow :D :D
By: VGR Date: 12/05/2003 05:11:00 English  Type : Comment
tell your boss to read <A HREF="http://www.bigpond.com/broadband/products/ADSL/default.asp">http://www.bigpond.com/broadband/products/ADSL/default.asp</a>

;-)
By: teustace Date: 12/05/2003 14:41:00 English  Type : Comment
I was trying to be funny by saying that my internet connection is like a tournequet as in a device for stopping or slowing the flow of blood through an artery by compression! This is a home connection and although broadband is available here in Tasmania, Australia, it is expensive.

I'm not an expat, just trying out my school girl french on you! I'm amazed your computer can hear my accent.
By: VGR Date: 12/05/2003 16:21:00 English  Type : Comment
funny guy :D
>
understood tourniquet now.

Do register to be able to answer

EContact
browser fav
page generated in 345.320940 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page