mysql.service – Start request repeated too quickly

 

Error:

root@Skeeve:/var/log# systemctl start mysql.service
Job for mysql.service failed because the control process exited with error code.
See “systemctl status mysql.service” and “journalctl -xe” for details.
root@Skeeve:/var/log# systemctl status mysql.service
● mysql.service – MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2021-05-30 15:33:27 CEST; 13s ago
    Process: 14145 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Process: 14153 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
   Main PID: 14153 (code=exited, status=1/FAILURE)
     Status: “Server startup in progress”
      Error: 13 (Operace zamítnuta)

kvě 30 15:33:27 Skeeve systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
kvě 30 15:33:27 Skeeve systemd[1]: Stopped MySQL Community Server.
kvě 30 15:33:27 Skeeve systemd[1]: mysql.service: Start request repeated too quickly.
kvě 30 15:33:27 Skeeve systemd[1]: mysql.service: Failed with result ‘exit-code’.
kvě 30 15:33:27 Skeeve systemd[1]: Failed to start MySQL Community Server.

 

Solution –  check or create the logfile:

root@Skeeve:/# cd /var/log
root@Skeeve:/var/log# mkdir mysqld.log # if mysql.d directory  does not exist
root@Skeeve:/var/log# chmod -R 640 mysqld.log
root@Skeeve:/var/log# chown -R mysql: mysqld.log
root@Skeeve:/var/log# ls -ld mysqld.log
drw-r—– 2 mysql mysql 4096 kvě 30 15:35 mysqld.log

 

Run mysql service:

root@Skeeve:/var/log# systemctl start mysql
root@Skeeve:/var/log# systemctl status mysql
● mysql.service – MySQL Community Server
      Loaded: loaded (/lib/systemd/system/mysql.service; disabled; vendor preset: enabled)
      Active: active (running) since Sun 2021-05-30 15:37:30 CEST; 12s ago
     Process: 14237 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
    Main PID: 14259 (mysqld)
      Status: “Server is operational”
       Tasks: 38 (limit: 11836)
      Memory: 380.5M
      CGroup: /system.slice/mysql.service
              └─14259 /usr/sbin/mysqld

kvě 30 15:37:08 Skeeve systemd[1]: Starting MySQL Community Server…
kvě 30 15:37:30 Skeeve systemd[1]: Started MySQL Community Server.