A strange issue stuck on my VPS when I was trying to restart by MySql server, its out of a sudden stop working and start throwing errors. I used certain commands to identify and want to share.
its started successfully now.
[....] Restarting mysql (via systemctl): mysql.serviceJob for mysql.service fail ed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
failed!
By using the command>> status mysql.service, system shows the errors given.
mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en
Active: failed (Result: exit-code) since Sat 2020-05-02 03:18:01 UTC; 4s ago
Process: 1810 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exit
May 02 03:18:01 vipin systemd[1]: mysql.service: Control process exited, code=ex
May 02 03:18:01 vipin systemd[1]: mysql.service: Failed with result 'exit-code'.
May 02 03:18:01 vipin systemd[1]: Failed to start MySQL Community Server.
May 02 03:18:01 vipin systemd[1]: mysql.service: Service hold-off time over, sch
May 02 03:18:01 vipin systemd[1]: mysql.service: Scheduled restart job, restart
May 02 03:18:01 vipin systemd[1]: Stopped MySQL Community Server.
May 02 03:18:01 vipin systemd[1]: mysql.service: Start request repeated too quic
May 02 03:18:01 vipin systemd[1]: mysql.service: Failed with result 'exit-code'.
May 02 03:18:01 vipin systemd[1]: Failed to start MySQL Community Server.
lines 1-14/14 (END)...skipping...
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2020-05-02 03:18:01 UTC; 4s ago
Process: 1810 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=1/FAILURE)
Commend journalctl -xe has given the actual cause of errors.
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit mysql.service has begun starting up.
May 02 03:55:22 vipin mysql-systemd-start[3490]: my_print_defaults: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at
May 02 03:55:22 vipin mysql-systemd-start[3490]: my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!
May 02 03:55:22 vipin mysql-systemd-start[3490]: ERROR: Unable to start MySQL server:
May 02 03:55:22 vipin mysql-systemd-start[3490]: mysqld: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 23!
May 02 03:55:22 vipin mysql-systemd-start[3490]: mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
May 02 03:55:22 vipin mysql-systemd-start[3490]: Please take a look at https://wiki.debian.org/Teams/MySQL/FAQ for tips on fixing common upgrade issu
May 02 03:55:22 vipin mysql-systemd-start[3490]: Once the problem is resolved, restart the service.
May 02 03:55:22 vipin systemd[1]: mysql.service: Control process exited, code=exited status=1
May 02 03:55:22 vipin systemd[1]: mysql.service: Failed with result 'exit-code'.
May 02 03:55:22 vipin 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.
May 02 03:55:22 vipin systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
May 02 03:55:22 vipin 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
Now its give a clear indidcation the show how file is missing with the group information added back in the file.
vim /etc/mysql/my.cnf add [mysqld] default-time-zone = "+05:30"
its started successfully now.
No comments:
Post a Comment