Unix Technical Forum

Cannot start mysqld and mysql

This is a discussion on Cannot start mysqld and mysql within the MySQL forums, part of the Database Server Software category; --> Ok, I know this is a newbie question, so I googled and followed every step at http://forums.mysql.com/read.php?11,...7569#msg-57569 http://forums.mysql.com/read.php?11,38797,38797 but ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 11:30 AM
Rob
 
Posts: n/a
Default Cannot start mysqld and mysql

Ok, I know this is a newbie question, so I googled and followed every
step at
http://forums.mysql.com/read.php?11,...7569#msg-57569
http://forums.mysql.com/read.php?11,38797,38797

but I still have the problem.
[root@myserver bin]# ./mysqld_safe --user=mysql
Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysqld/mysqld.pid
071119 13:53:56 mysqld ended

[root@myserver bin]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (111)

I've done chown -R mysql:mysql /var/lib/mysql (although I don't
understand why)
I've noticed that there is already a mysql.sock at /var/lib/mysql
and I don't know how to use mysql.server instead of mysqld_safe

help please!!






Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 11:30 AM
Peter H. Coffin
 
Posts: n/a
Default Re: Cannot start mysqld and mysql

On Mon, 19 Nov 2007 10:58:38 -0800 (PST), Rob wrote:
> Ok, I know this is a newbie question, so I googled and followed every
> step at
> http://forums.mysql.com/read.php?11,...7569#msg-57569
> http://forums.mysql.com/read.php?11,38797,38797
>
> but I still have the problem.
> [root@myserver bin]# ./mysqld_safe --user=mysql
> Starting mysqld daemon with databases from /var/lib/mysql


Server starts...

> STOPPING server from pid file /var/run/mysqld/mysqld.pid
> 071119 13:53:56 mysqld ended


And server quits...
>
> [root@myserver bin]# mysql
> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
> '/var/lib/mysql/mysql.sock' (111)


The server quit. Is there any reason to expect to be able to connect to
a server that isn't running?

> I've done chown -R mysql:mysql /var/lib/mysql (although I don't
> understand why)
> I've noticed that there is already a mysql.sock at /var/lib/mysql
> and I don't know how to use mysql.server instead of mysqld_safe
>
> help please!!


Find logs. Figure out from them why the server is quitting. Fix that.

--
CS is about lofty design goals and algorithmic optimization. Sysadmining
is about cleaning up the fscking mess that results.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 11:30 AM
Michael Martinek
 
Posts: n/a
Default Re: Cannot start mysqld and mysql

> I've done chown -R mysql:mysql /var/lib/mysql (although I don't
> understand why)


I recently ran into this problem with building MySQL with plugin
support (since RPM builds didn't support it).

The reason you did chown -R mysql:mysql was to assign ownership and
group to the files. This prevents individuals who are not mysql, or
within the mysql group from editing the files (depending on the chmod
permissions).

First, if MySQL isn't running.. make sure the PID and sock file are
gone:

rm /var/run/mysqld/mysqld.pid
rm /var/lib/mysql/mysql.sock

Then try your mysql_safe.. if it doesn't work, try also doing:

chown mysql:root /var/run/mysqld
chmod 755 /var/run/mysqld

Regards,
Michael Martinek
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:02 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com