Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-28-2006, 06:21 PM
|
#1
|
Member
Registered: Aug 2005
Distribution: Ubuntu 7.10, Slackware 12
Posts: 270
Rep:
|
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?
|
|
|
05-28-2006, 06:41 PM
|
#2
|
Senior Member
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783
Rep:
|
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:
2.After you are root log in as mysql user (!! THIS IS REALY IMPORTANT!!):
3. Initialize mysql:
4. Now logout from mysql user:
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
|
|
|
05-28-2006, 06:44 PM
|
#3
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
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
|
|
|
05-28-2006, 06:52 PM
|
#4
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
05-28-2006, 06:59 PM
|
#5
|
Senior Member
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783
Rep:
|
Quote:
Originally Posted by gilead
|
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.
|
|
|
05-31-2006, 02:42 PM
|
#6
|
LQ Newbie
Registered: May 2006
Distribution: Fedora Core 5
Posts: 12
Rep:
|
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 ...
|
|
|
05-31-2006, 02:46 PM
|
#7
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
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
|
|
|
05-31-2006, 02:54 PM
|
#8
|
LQ Newbie
Registered: May 2006
Distribution: Fedora Core 5
Posts: 12
Rep:
|
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 ...
|
|
|
05-31-2006, 08:14 PM
|
#9
|
Senior Member
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783
Rep:
|
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.
|
|
|
06-01-2006, 08:25 AM
|
#10
|
LQ Newbie
Registered: May 2006
Distribution: Fedora Core 5
Posts: 12
Rep:
|
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.
|
|
|
06-01-2006, 09:06 AM
|
#11
|
LQ Newbie
Registered: May 2006
Distribution: Fedora Core 5
Posts: 12
Rep:
|
hey, don't worry about my last post.... I simply uninstalled and reinstall sql and sql-server and now it works! hooray
|
|
|
All times are GMT -5. The time now is 03:41 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|