2

When I try to start Mysql on Fedora via systemctl start mysqld.service, it hangs indefinitely and never starts. Running mysqld_safe --skip-grant-tables & or mysqld_safe --nowatch --basedir=/usr starts the server just fine, indicating the database is still there, but using service or systemctl doesn't work at all. Nothing is shown in /var/log/mysqld.log. However, `/var/log/messages shows thousands of messages like:

Oct 29 15:55:52 myserver systemd[1]: mysqld.service holdoff time over, scheduling restart.
Oct 29 15:55:52 myserver systemd[1]: Job pending for unit, delaying automatic restart.

How do I diagnose what's wrong and get MySQL to start?

3 Answers 3

2

mysqld and mysqld_safe are different binaries with different "interpretations" of the config file. Check this link to learn more about it. The most common situation is that one of the my.cnf values is out of place preventing mysqld.service to start but this config value is ignored by mysqld_safe.

You can also try running:

mysqld --help --verbose

to diagnose startup problems that may not be logged to the regular logs.

5
  • The default mysqld.service config file on Fedora uses mysqld_safe as the binary, not mysqld. There's no mysqld binary available in the path on Fedora.
    – Cerin
    Oct 30, 2013 at 4:18
  • Have you tried creating a new script for systemd? by the way, wich Fedora version are you using? is it an upgrade? When I upgraded to Fedora 19 I had to create a new startup script for httpd because it was unable to start. Oct 30, 2013 at 14:17
  • Why would I want to rewrite the default systemd script? It was working just fine. As this is a semi-production environment, I'm still using Fedora 16 and can't easily upgrade it.
    – Cerin
    Dec 3, 2013 at 17:32
  • @Cerin because after updates, configuration changes and module changes among others, configuration and/or startup parameters may change, that's why it may come handy to rebuild config files or startup scripts. I'm glad that you finally found a solution. Dec 4, 2013 at 23:11
  • Well, I simply reinstalled it and that fixed it. I would highly recommend against overriding the default scripts, and that's almost never worked for me.
    – Cerin
    Dec 5, 2013 at 3:57
0

in my.cnf, you can specify commands for each "interpretation"

so you could have

[mysql]
port=3309

[mysqld]
port=3309

[mysqladmin]
[port=3309]

as long as the defaults file with each binary is used, any of the 3 binaries will connect to tcp/3309

this type of mismatch happens sometimes and is annoying

1
  • I haven't changed the port. And mysqladmin still controls mysql just fine. It's only systemctl that doesn't work.
    – Cerin
    Oct 30, 2013 at 4:19
0

I'm not sure what the original cause or underlying problem was, but reinstalling the mysql packages and then rebooting fixed it.

yum reinstall mysql mysql-server
reboot
1

You must log in to answer this question.

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