STOPPING server from pid file - mysql 5.0

chris (2005-10-30 20:32:09)
4 replies
If you've stumbled upon this posting, it's probably because you're having problems starting a newly built mysql server. It took me a while to sort this out - I have just put mysql 5.0 (actually 5.0.15-standard-log) on my laptop, but had trouble starting the server when using my existing my.cnf which I'd been using with 4.0.1-log. I guess mysql 5 is a bit more fussy over permissions (mysql has always been a bit of a permissions whore). I noticed that when I commented my datadir line out of the my.conf, the server would start just fine, but of course it used the default data locations, so none of my databases were visible.. Well at least that pointed out where the problem lied - it was a permissions issue on the data directory. All I did was a chown -R mysql.mysql /export/data and everything was fine again

hope that helps somebody..

2007-01-21 23:26:23

tell the mysql server who to run as

Another way to fix this is to tell mysql server to run up as root like this:

/usr/bin/mysqld_safe --user=root &

I'm not not aware of any security issues with that, but you'll find that it fixes the issue described.

Tri Boisch
reply icon
2006-10-14 19:17:29

What did you do to solve this? Only changes to /etc/my.cnf?
reply icon
2006-10-07 12:16:24

just to make this clearer for standard mysql package installation on linux systems, this is how I would fix this on a new Slackare installation running mysql:

first the problem:

root@baikal:/usr# Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/lib/mysql/
061007 11:57:40 mysqld ended

[1]+ Done /usr/bin/mysqld_safe

and the solution:

root@baikal:/usr# cd /usr/; /usr/bin/mysqld_safe &
[1] 20620
root@baikal:/usr# Starting mysqld daemon with databases from /var/lib/mysql


happy days!

reply icon
Kirk Baucom
2009-08-15 04:04:45


You can get the same error if you haven't updated your apparmor config to reference the new data path. Look for the mysql file in /etc/apparmor.d and change the default data paths (/var/lib/mysql) to wherever you've put your data. There's also a mysql file /etc/apparmor.d/abstractions. Run '/etc/init.d/apparmor reload' and start mysql.
reply iconedit reply