LinuxQuestions.org
Review your favorite Linux distribution.
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 11-29-2004, 01:16 PM   #1
AJ_Cantos
LQ Newbie
 
Registered: Nov 2004
Location: Spain
Distribution: Slackware 10.1
Posts: 26

Rep: Reputation: 15
Question MySQL server doesn't want to start


When I tried to start mysql I got this message:

/usr/local/bin> mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

So I thought it was the server that was not running, and I did:

/usr/local/bin> mysqld
bash: mysqld: command not found

I tried it as root:

/usr/local/bin> su
Password:
/usr/local/bin # mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Another time the same error message, and for mysqld:

/usr/local/bin # mysqld
Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
041129 20:11:07 Aborting

041129 20:11:07 mysqld: Shutdown Complete

I tried with mysqld_safe and:

/usr/local/bin # mysqld_safe
Starting mysqld-max daemon with databases from /var/lib/mysql
041129 20:12:07 mysqld ended

loads of different error messages and no idea what to do with them.

Could anyone please help me starting the mysql daemon.

Thanks in advance.
Alex.
 
Old 11-29-2004, 01:24 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Check that the user your mysql server is running as (usually mysql) has read and write access to the database files. This is the most common cause.
 
Old 11-29-2004, 01:30 PM   #3
basse-
LQ Newbie
 
Registered: Mar 2004
Location: Tampere, Finland
Distribution: Gentoo 2004.3, Ubuntu
Posts: 15

Rep: Reputation: 0
I'd begin by doing

Code:
shell> scripts/mysql_install_db --user=mysql
and then

Code:
shell> bin/mysqld_safe --user=mysql &
 
Old 11-29-2004, 01:46 PM   #4
AJ_Cantos
LQ Newbie
 
Registered: Nov 2004
Location: Spain
Distribution: Slackware 10.1
Posts: 26

Original Poster
Rep: Reputation: 15
I did:

Albatross:/usr/local/bin # mysql_install_db --user=mysql
Installing all prepared tables
041129 20:41:44 /usr/sbin/mysqld-max: Shutdown Complete


PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h Albatross password 'new-password'
See the manual for more instructions.

NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!


You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com

And then:

Albatross:/usr/local/bin # mysqld_safe --user=mysql
Starting mysqld-max daemon with databases from /var/lib/mysql
041129 20:43:12 mysqld ended

It still doesn't work, and if I must check that mysql user has read and write access, how should I do that?

Please help me.
Thanks.
Alex.
 
Old 11-29-2004, 01:53 PM   #5
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Check the permissions with:
ls -l /path/to/mysql/data
 
Old 11-29-2004, 03:45 PM   #6
AJ_Cantos
LQ Newbie
 
Registered: Nov 2004
Location: Spain
Distribution: Slackware 10.1
Posts: 26

Original Poster
Rep: Reputation: 15
I've checked the read and write permissions of /var/lib/mysql and have changed the owner, group and mo to root, root and 777. I've tried again and nothing new happened, the same messages are shown and the daemon doesn't start.

Could someone please give an idea?

Thanks all.
Alex.
 
Old 11-29-2004, 03:53 PM   #7
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
What user is mysql running as?
Try:
chown -R mysql:mysql /var/lib/mysql
chmod -R 755 /var/lib/mysql
find /var/lib/mysql -type f -exec chmod -R 640 {} \;
/etc/init.d/msyqld restart

Last edited by david_ross; 11-29-2004 at 03:55 PM.
 
Old 11-29-2004, 04:24 PM   #8
Ironica
Member
 
Registered: Jan 2003
Distribution: LFS
Posts: 64

Rep: Reputation: 15
I usually start it by running:
/etc/init.d/mysql start
Never tryed just running "mysql", until now, and I got exactly the same message as you.
 
  


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
how do I start mysql server? barrythai SUSE / openSUSE 4 04-05-2006 05:46 PM
Trying to start Mysql server number11 Linux - Newbie 3 06-06-2005 01:59 PM
How to start mysql server krussell Linux - General 2 01-19-2004 10:24 AM
Mysql server will not start using OS Suse 8.1 steverino Linux - Software 3 03-06-2003 03:00 AM
Proplems start MySQL server... Simon W Linux - General 1 03-09-2002 04:32 PM

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

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