8

After a restart, mysql won't start. sudo service mysql start gives start: Job failed to start and the logs are empty, so I have no idea where to start. I'm pretty sure permissions problems are taken care of.

Edit:
All disks have at least 1G of space and sh -x /etc/init.d/mysql start gives me:

+ set -e
+ basename /etc/init.d/mysql
+ INITSCRIPT=mysql
+ JOB=mysql
+ [ mysql = upstart-job ]
+ [ -z start ]
+ COMMAND=start
+ shift
+ [ -z  ]
+ ECHO=echo
+ echo Rather than invoking init scripts through /etc/init.d, use the service(8)
Rather than invoking init scripts through /etc/init.d, use the service(8)
+ echo utility, e.g. service mysql start
utility, e.g. service mysql start
+ echo

+ echo Since the script you are attempting to invoke has been converted to an
Since the script you are attempting to invoke has been converted to an
+ echo Upstart job, you may also use the start(8) utility, e.g. start mysql
Upstart job, you may also use the start(8) utility, e.g. start mysql
+ grep -q  start/
+ status mysql
+ [ -z  ]
+ [ start = stop ]
+ [ -n  ]
+ start mysql
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.105" (uid=1000 pid=3208 comm="start mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")

4
  • /etc/init.d/mysqld start nothing in /var/log/messages or /var/log/mysqld ? Jan 29, 2012 at 21:33
  • 1
    Do you have any full disks? If the log disk is full, it can't write a log.
    – Mike Scott
    Jan 29, 2012 at 21:44
  • Having exactly the same problem. Did you find a solution for it? None of the answers here fixed the problem. :/
    – Torsten
    Jun 11, 2012 at 3:26
  • I believe I had to reinstall (purge with a manual backup of /var/lib/mysql)
    – Owen
    Jun 16, 2012 at 23:25

4 Answers 4

4

This message comes from the service script, not from mysql. So you have to look at the script and figure where/why it fails.

Do that by calling sh -x /etc/init.d/mysqld start.

note: on some questions, like this one, I don't see any "add comment". I only have the option to add an answer. How can I just add a comment ?

2
  • Gregory, I believe you don't have the ability yet. You get more access as you build reputation. It's probably to prevent automated spam comments on spam posts by newly created users.
    – Kyle Smith
    Jan 29, 2012 at 21:52
  • 1
    Well this is an answer and not a comment. To outline it a bit further I will edit Gergorys answer a bit.
    – Nils
    Jan 29, 2012 at 22:15
3

Same issue here, for me the reason was, that the my.cnf file has been moved from /etc/my.cnf to /etc/mysql/my.cnf, but there still was a "dead" symlink pointing to /etc/my.cnf.

Check if /etc/mysql/my.cnf is a symlink:

user@machine:~ $ ls -l /etc/mysql/my.cnf
lrwxrwxrwx 1 root root 9 Jan 11  2011 /etc/mysql/my.cnf -> ../my.cnf

If it is a symlink, check if the target file exists. If not, remove the symlink and create /etc/mysql/my.cnf from /etc/mysql/my.cnf.dpkg-new or something like that... if you have it.

sudo unlink /etc/mysql/my.cnf
sudo mv /etc/mysql/my.cnf.dpkg-new /etc/mysql/my.cnf

P.S: If the symlink's target is existing, you might want to check dmesg | grep cnf for apparmor error messages.

2

This problem can occur if the pid file still exists, such as after a crash. Check for that and delete it if it does exist.

The pid file location defaults to /var/run/mysqld/mysqld.pid but a different location may be set in the config file.

1
  • This can be cleared by stopping mysql (even if it isn't running), and starting it up again. Feb 21, 2022 at 15:17
0

This just happened to me. The filesystem was 100% full

Confirm with: df -h /

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .