1

For the first time in my life, I have Ubuntu, so I do not know much how to manage and what should I be looking for; I'm using version 18.04. I installed MySQL 5.7, it worked great for a couple of days and suddenly it can't even restart, doesn't start again (with service mysql start or anything)...

Using systemctl status mysql.service I get:

● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor 
preset: enabled)
Active: failed (Result: exit-code) since Thu 2018-07-26 14:24:49 CEST; 
10min ago
Process: 3758 ExecStart=/usr/sbin/mysqld --daemonize --pid- 
file=/run/mysqld/mysqld.pid (code=exited
Process: 3749 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre 
(code=exited, status=0/SUCCESS)

јул 26 14:24:49 maax systemd[1]: mysql.service: Service hold-off 
time over, scheduling restart.
јул 26 14:24:49 maax systemd[1]: mysql.service: Scheduled 
restart 
job, restart counter is at 5.
јул 26 14:24:49 maax systemd[1]: Stopped MySQL Community Server.
јул 26 14:24:49 maax systemd[1]: mysql.service: Start request 
repeated too quickly.
јул 26 14:24:49 maax systemd[1]: mysql.service: Failed with 
result 'exit-code'.
јул 26 14:24:49 maax systemd[1]: Failed to start MySQL Community 
Server.

and using journalctl -xe I get:

јул 26 14:24:49 maax systemd[1]: mysql.service: Scheduled 
restart job, restart counter is at 5.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Automatic restarting of the unit mysql.service has been scheduled, 
as the result for
-- the configured Restart= setting for the unit.
јул 26 14:24:49 maax systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit mysql.service has finished shutting down.
јул 26 14:24:49 maax systemd[1]: mysql.service: Start request 
repeated too quickly.
јул 26 14:24:49 maax systemd[1]: mysql.service: Failed with 
result 'exit-code'.
јул 26 14:24:49 maax systemd[1]: Failed to start MySQL Community 
Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit mysql.service has failed.
-- 
-- The result is RESULT.

What should I do to fix this and continue to use Mysql every day normally? Mysql works okay when I reinstall it, but after some time, it crushes again...

-1

The error log of MySQL records the details why MySQL can not restart, check the error log and update it in Questions would be helpful.

If MySQL is installed by apt-get or some other system's ways and uses the default configurations, error log always in /var/log/mysql.

If my.cnf changes, check the modified my.cnf in /etc/mysql/my.cnf or other paths to find the log_error param.

| improve this answer | |
  • it says it should be here : log_error = /var/log/mysql/error.log like you said, but I don't have that folder anymore, i don't know why, nothing was changed in my.cnf. Now i made again mysql folder but it's empty ofc – Simon Jul 27 '18 at 9:57
  • try to use mysqld_safe to start the mysql, the error log should print in stdout @Max – Wang Wen'an Jul 30 '18 at 1:43
  • @Max - Run it again; then quickly grab the mysqld.err before it (what?) deletes it. – Rick James Aug 16 '18 at 23:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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