LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-28-2006, 06:21 PM   #1
dave`2005
Member
 
Registered: Aug 2005
Distribution: Ubuntu 7.10, Slackware 12
Posts: 270

Rep: Reputation: 30
mysql wont start


Hi all,

When trying to start mysql using "mysql" i get
Code:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
Ive looked around but cant find any info on this error message.

Anyone know how to fix this?
 
Old 05-28-2006, 06:41 PM   #2
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
mysql is the mysql terminal. But in order to use this, you need to start the mysql deamon (the database itself).

If you have never done this before (starting the Mysql deamon), you need to install the initial database:

1. Log in as root:
Code:
su
2.After you are root log in as mysql user (!! THIS IS REALY IMPORTANT!!):
Code:
su mysql
3. Initialize mysql:
Code:
mysql_install_db
4. Now logout from mysql user:
Code:
exit
5.Now as root start the mysql deamon:
Code:
. /etc/rc.d/rc.mysqld start
Now You can use mysql to log into the database.

After having done this once, in order to run the mysql deamon you only need to use step 5.

To stop the deamon do this:
Code:
. /etc/rc.d/rc.mysqld stop
If you want the mysql deamon to automatically start every time you boot slackware do as root:
Code:
chmod +x /etc/rc.d/rc.mysqld
 
Old 05-28-2006, 06:44 PM   #3
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
The post at http://forums.mysql.com/read.php?11,...4584#msg-24584 suggests that the problem can be caused by not having the server part of the software installed. Do you have all of the MySQL server components installed and running?

Last edited by gilead; 05-28-2006 at 06:47 PM. Reason: Already covered in-depth by perfect_circle
 
Old 05-28-2006, 06:52 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
perfect_circle, is correct. If the service isn't running, that is exactly the message you will see. ( In other words, I've done the same thing )


Look in /usr/share/doc/packages/mysql/manual.pdf for documentation. There is a section on starting mysql, which is usually installed as a service. Look at the mysql_safe manpage. Your rc.mysqld script probably uses mysqld_safe to start the server. If you look at the services configuration for your distro, you will probably see that there is a mysqld service installed but not running.

Also make sure you read the section on setting your initial accounts and securing mysql. It currently is open using generic accounts.

Last edited by jschiwal; 05-28-2006 at 06:54 PM.
 
Old 05-28-2006, 06:59 PM   #5
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
Quote:
Originally Posted by gilead
The post at http://forums.mysql.com/read.php?11,...4584#msg-24584 suggests that the problem can be caused by not having the server part of the software installed. Do you have all of the MySQL server components installed and running?
The most common case causing this is not having the daemon running at all:

Code:
skalkoto@darkstar:~$ su
Password:
root@darkstar:/home/skalkoto# . /etc/rc.d/rc.mysqld stop
root@darkstar:/home/skalkoto# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
root@darkstar:/home/skalkoto# . /etc/rc.d/rc.mysqld start
Starting mysqld daemon with databases from /var/lib/mysql
root@darkstar:/home/skalkoto#
root@darkstar:/home/skalkoto# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
root@darkstar:/home/skalkoto#
Of course I did not manage to connect because I have configured the database to require a password but the "Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock'" error was because of not running the daemon at all. In slackware the whole mysql (server and client) is in one package that is installed in the standard process. SO I guess not having all of the MySQL server components installed is not the case. Having the mysql executable probably means he has the whole mysql package installed.

Last edited by perfect_circle; 05-28-2006 at 07:01 PM.
 
Old 05-31-2006, 02:42 PM   #6
jharvey
LQ Newbie
 
Registered: May 2006
Distribution: Fedora Core 5
Posts: 12

Rep: Reputation: 0
Hi, I am having the same problem as the first fellow, I am running fedora core 5 by the way. I followed your instructions and I was able to start the database and I made sure that MySQL server was installed. However when I try to run this
Code:
./etc/rc.d/rc.mysqld start
I get this error
Code:
bash: ./etc/rc.d/rc.mysqld: No such file or directory
Does this mean I haven't installed MySQL properly? Also I cannot find a mysql.sock file on my computer. I tried to use the locate function and it returned no results. This absence of files makes me think I installed mysql wrong ... but I used yum and it was installed for me ... I am confused ...
 
Old 05-31-2006, 02:46 PM   #7
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Have you tried it without the leading period? There's a space between the period and the /etc/rc.d/rc.mysqld in perfect_circle's post. For example, try:
Code:
/etc/rc.d/rc.mysqld start
 
Old 05-31-2006, 02:54 PM   #8
jharvey
LQ Newbie
 
Registered: May 2006
Distribution: Fedora Core 5
Posts: 12

Rep: Reputation: 0
Code:
[root@pc-00076 /]# /etc/rc.d/rc.mysqld start
bash: /etc/rc.d/rc.mysqld: No such file or directory
rc.mysqld does not exist in the /etc/rc.d directory... or anywhere else on my computer ...
 
Old 05-31-2006, 08:14 PM   #9
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
Quote:
Originally Posted by gilead
Have you tried it without the leading period? There's a space between the period and the /etc/rc.d/rc.mysqld in perfect_circle's post. For example, try:
Code:
/etc/rc.d/rc.mysqld start
Guys, if you pay attention to what exactly I execute its:
.<space>/etc/rc.d/rc.mysqld start

I put the .<space> in front in onder to make the system execute
/etc/rc.d/rc.mysqld start even without having set the execute permission in /etc/rc.d/rc.mysqld.

If you set the execute permission in rc.mysqld you will have mysqld executed every time you boot.


Quote:
Originally Posted by jharvey
rc.mysqld does not exist in the /etc/rc.d directory... or anywhere else on my computer ...
Of course not!!!!
If you see the thread-starters signature he is using slackware and the thread is in the slackware forum. Those instructions are for slackware only!!
If your signature is correct you are using Fedora Core 5
Search the desktop menu for a utility on how to start mysql service in Fedora. I haven't used fedora for a long time.
I cannot remember any more.

Last edited by perfect_circle; 05-31-2006 at 08:15 PM.
 
Old 06-01-2006, 08:25 AM   #10
jharvey
LQ Newbie
 
Registered: May 2006
Distribution: Fedora Core 5
Posts: 12

Rep: Reputation: 0
ok, so I found out how to start mysql in FC5 ... however when I run
Code:
 [root@pc-00076 jharvey]# /sbin/service mysqld start
I am getting this error:
Code:
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL:                                            [FAILED]
I've tried the first code with the period and then a space ... with just the period ... with no period ... all returns this same error.
 
Old 06-01-2006, 09:06 AM   #11
jharvey
LQ Newbie
 
Registered: May 2006
Distribution: Fedora Core 5
Posts: 12

Rep: Reputation: 0
hey, don't worry about my last post.... I simply uninstalled and reinstall sql and sql-server and now it works! hooray
 
  


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
MySQL - Timeout error occurred trying to start MySQL Daemon. stuartornum Linux - Software 3 02-26-2006 12:54 PM
X wont start fester2001 Linux - Software 2 09-02-2004 12:12 AM
MySql error 2002, Cannot start mysql djchris Linux - Software 5 04-13-2004 06:12 PM
mysql just wont work nocturnal Linux - Software 13 07-10-2003 08:02 AM
mysql wont stop Zac2003 Linux - Software 5 05-06-2003 11:35 PM

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

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