Mysql 5.7 cannot start again

connectionserrorsMySQLmysql-5.7

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…

Best Answer

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.