LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 10-11-2006, 01:23 PM   #1
Parthava
LQ Newbie
 
Registered: Oct 2006
Location: USA
Distribution: Fedora 3, 4, 5
Posts: 6

Rep: Reputation: 0
mysql error


Hi,
I have Fedora Core 5 installed on my computer with dual OP Windows XP. Yesterday, I was trying to use MySQL, so I put mysql command on the terminal and it gives me the following error:

ERROR 2002 (HY000): Can't connect to local MySQL Server through Socket '/var/lib/mysql/mysql.sock' (2)

is somebody can help me to figure out?
 
Old 10-11-2006, 01:45 PM   #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
$10 says you've not started the mysql service.
 
Old 10-11-2006, 01:58 PM   #3
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Code:
service mysql start
or
Code:
/etc/init.d/mysql start
I recall either of those should work..basically they're the same. But if you want mysql to run every time you boot, you'll have to alter your runlevel config.
 
Old 10-11-2006, 04:15 PM   #4
babysparrow
Member
 
Registered: Nov 2005
Location: Worcestershire,UK
Distribution: Used nearly all but now just using Lubuntu 18.04lts and 20.04 lts
Posts: 94

Rep: Reputation: 19
b0uncer : don't you mean service mysqld (with a 'd')?

I'm running FC5 and mysql isn't a recognised service.

(FYI).
 
Old 10-12-2006, 11:26 AM   #5
Parthava
LQ Newbie
 
Registered: Oct 2006
Location: USA
Distribution: Fedora 3, 4, 5
Posts: 6

Original Poster
Rep: Reputation: 0
same mysql error

I tried both,
Code:
service mysql start
and

Code:
/etc/init.d/mysql start
unfortunately it didn't work and it gives me the same error. Do you mean
Quote:
mysqld
instead of
Quote:
mysql
? What is the difference between mysql and mysqld?
 
Old 10-13-2006, 07:50 PM   #6
babysparrow
Member
 
Registered: Nov 2005
Location: Worcestershire,UK
Distribution: Used nearly all but now just using Lubuntu 18.04lts and 20.04 lts
Posts: 94

Rep: Reputation: 19
OK.

Try this :
Quote:
/etc/rc.d/init.d/mysqld start
If this does not work, what error is it giving ?

Try :
Quote:
ps -ef | grep mysqld
What do you get ?
 
Old 10-13-2006, 08:06 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Look for /usr/share/doc/packages/mysql/manual.pdf or /usr/share/doc/packages/mysql/manual.ps. There are a few things that you need to do after installing mysql to secure it. The manual also has trouble shooting information.

After starting the service you will want to use mysqladmin to give yourself the priviledges you need. Later, you will normally start mysql like:
mysql -u username -p
<password>

Good Luck.
 
Old 10-13-2006, 08:12 PM   #8
babysparrow
Member
 
Registered: Nov 2005
Location: Worcestershire,UK
Distribution: Used nearly all but now just using Lubuntu 18.04lts and 20.04 lts
Posts: 94

Rep: Reputation: 19
jschiwal : I think parthava has not got the mysqld to start , so he won't be able to use the admin tools yet. Unless we've got past this point
Quote:
ERROR 2002 (HY000): Can't connect to local MySQL Server through Socket '/var/lib/mysql/mysql.sock' (2)
 
Old 10-14-2006, 07:54 AM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I guess I was jumping ahead a bit. His syntax to start the MySQL monitor didn't look quite right.

He could try (for testing purposes) starting mysql with the command "sudo -u mysql /usr/bin/mysql_safe &"

And then run "mysqladmin -u root -p <rootpassword> status" to verify whether it started or not.
sudo /sbin/chkconfig -l mysql will list the runlevels that mysql should run under. He could use this command to automatically start the server when he boots the machine, assuming the service will start.
 
Old 10-16-2006, 04:52 PM   #10
Parthava
LQ Newbie
 
Registered: Oct 2006
Location: USA
Distribution: Fedora 3, 4, 5
Posts: 6

Original Poster
Rep: Reputation: 0
Hi The problem has been fixed. I went to /etc/rc.d/init.d/ and then as a root user, I gave the command
Quote:
./mysqld start
and that's how I started the daemon. Thank you very much for all your help. I really appreciate it. Thanks to linux community.
 
Old 10-16-2006, 05:00 PM   #11
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
no suprise there then... it's *always* that, as you would have seen had you scrolled to the bottom of the page to see all the identical threads.
 
Old 10-17-2006, 05:28 AM   #12
sohailark
LQ Newbie
 
Registered: Feb 2006
Posts: 10

Rep: Reputation: 0
i have found a web site for learning mysql, and want to share it with this cummunity web site address is
http://adminschoice.sytes.net
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 03:13 PM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 02:52 AM
Starting MySQL OLD Error : imeout error occurred trying to start MySQL Daemon Fr33B5D Linux - Software 9 10-28-2006 07:23 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 09:44 AM
MySQL - Timeout error occurred trying to start MySQL Daemon. stuartornum Linux - Software 3 02-26-2006 01:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 01:36 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