Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

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.

share|improve this answer
    
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 '13 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. –  Juan Carlos Brown Oct 30 '13 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 '13 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. –  Juan Carlos Brown Dec 4 '13 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 '13 at 3:57

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

share|improve this answer
    
I haven't changed the port. And mysqladmin still controls mysql just fine. It's only systemctl that doesn't work. –  Cerin Oct 30 '13 at 4:19
up vote 0 down vote accepted

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.