Notifications MySQL not running, while actually running

rappie

Active Member
Oct 4, 2008
29
4
53
Amsterdam
I am receiving email notifications after I rebooted my VPS about the MySQL not running. In WHM I can see the MySQL service marked as down. However, MySQL seems to running fine. When I run the command
Code:
service mysql status
I get
Code:
SUCCESS! MariaDB running (5139)
When I run
Code:
/scripts/restartsrv_mysql
I get

Code:
Waiting for “mysql” to start ……info [restartsrv_mysql] systemd failed to start the service “mariadb” (The “/usr/bin/systemctl restart mariadb.service --no-ask-password” command (process 16926) reported error number 1 when it ended.): Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.

…Unrecognized configuration options may have caused the MySQL startup errors.

The system has attempted to auto-update your MySQL configuration file for your MySQL version.

This should resolve any errors that stem from an outdated MySQL configuration file.

info [restartsrv_mysql] systemd failed to start the service “mariadb” (The “/usr/bin/systemctl restart mariadb.service --no-ask-password” command (process 17048) reported error number 1 when it ended.): Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.

…Unrecognized configuration options may have caused the MySQL startup errors.

The system has attempted to auto-update your MySQL configuration file for your MySQL version.

This should resolve any errors that stem from an outdated MySQL configuration file.

info [restartsrv_mysql] systemd failed to start the service “mariadb” (The “/usr/bin/systemctl restart mariadb.service --no-ask-password” command (process 17155) reported error number 1 when it ended.): Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.

…failed.

Cpanel::Exception::Services::StartError
Service Status

Service Error
(XID 9d55d7) The “mysql” service failed to start.

Startup Log
jun 29 19:56:03 vps004.example.net systemd[1]: Starting MariaDB 10.3.16 database server...
jun 29 19:56:03 vps004.example.net mysqld[17194]: 2019-06-29 19:56:03 0 [Note] /usr/sbin/mysqld (mysqld 10.3.16-MariaDB) starting as process 17194 ...
jun 29 19:57:33 vps004.example.net systemd[1]: mariadb.service start operation timed out. Terminating.
jun 29 19:58:15 vps004.example.net systemd[1]: mariadb.service: main process exited, code=exited, status=1/FAILURE
jun 29 19:58:15 vps004.example.net systemd[1]: Failed to start MariaDB 10.3.16 database server.
jun 29 19:58:15 vps004.example.net systemd[1]: Unit mariadb.service entered failed state.
jun 29 19:58:15 vps004.example.net systemd[1]: mariadb.service failed.

mysql has failed. Contact your system administrator if the service does not automagically recover.
I am not sure how to solve this. Any one any suggestions?
 
Last edited:

rappie

Active Member
Oct 4, 2008
29
4
53
Amsterdam
@cPanelLauren

Thank you for your reply. This seems to resolve the issue.

What would be the proper way to restart the MySQL service trough the command line? Should I use
service mysql restart or /scripts/restartsrv_mysql?
 

backupmx

Member
Jul 25, 2018
9
2
3
India
cPanel Access Level
Root Administrator
You can use the several method to restart your MySQL but correct way should be as below.

#systemctl restart mysqld.service
#/scripts/restartsrv_mysql --restart
#/scripts/restartsrv_mysql --restart --hard [for forcefully restart]
#/scripts/restartsrv_mysql

or you can first stop the MySQL then start as said by @cPanelLauren earlier


#/scripts/restartsrv_mysql --stop
#/scripts/restartsrv_mysql --start
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,262
313
Houston
We'll always recommend using /scripts/restartsrv_service scripts such as the one I provided to you when they're available. You can get available flags for it using the --help flag as well:

Code:
[[email protected] ~]# /scripts/restartsrv_mysql --help
/scripts/restartsrv_mysql - manage service mysql

Usage: /scripts/restartsrv_mysql [ACTION] [OPTIONS]

The default action is to restart the mysql service.

The script returns 0 in case of success,
and a positive integer in case of an error.

Note: Error output is displayed on STDERR.

Available actions:
   --help           Display this help message.
   --restart        Restart the service (via a soft restart, if available). [default action]
   --hard           Perform a hard restart (skip the soft restart).
                    This is the default action if soft restarts aren't supported for the service.
   --graceful       Attempt a graceful restart of the service, if the service supports this action.
   --reload         Reload the service, if the service supports this action.
   --stop           Stop the service.
   --status         Return the current service status via the exit code.

Available options:
   --notconfigured-ok    Services that are not configured will exit with a non-fatal return code
                             (this does not mean they'll carry out the requested action, ie start)

Sample usages:
# Restart the service (using a "soft" or "graceful" restart when supported)
> /scripts/restartsrv_mysql
> /scripts/restartsrv_mysql --restart
# Stop the service.
> /scripts/restartsrv_mysql --stop
# Perform a hard restart.
> /scripts/restartsrv_mysql --restart --hard
 

yogisparingga

Registered
Nov 5, 2019
4
1
3
Lubuklinggau
cPanel Access Level
Root Administrator
hy i
We'll always recommend using /scripts/restartsrv_service scripts such as the one I provided to you when they're available. You can get available flags for it using the --help flag as well:

Code:
[[email protected] ~]# /scripts/restartsrv_mysql --help
/scripts/restartsrv_mysql - manage service mysql

Usage: /scripts/restartsrv_mysql [ACTION] [OPTIONS]

The default action is to restart the mysql service.

The script returns 0 in case of success,
and a positive integer in case of an error.

Note: Error output is displayed on STDERR.

Available actions:
   --help           Display this help message.
   --restart        Restart the service (via a soft restart, if available). [default action]
   --hard           Perform a hard restart (skip the soft restart).
                    This is the default action if soft restarts aren't supported for the service.
   --graceful       Attempt a graceful restart of the service, if the service supports this action.
   --reload         Reload the service, if the service supports this action.
   --stop           Stop the service.
   --status         Return the current service status via the exit code.

Available options:
   --notconfigured-ok    Services that are not configured will exit with a non-fatal return code
                             (this does not mean they'll carry out the requested action, ie start)

Sample usages:
# Restart the service (using a "soft" or "graceful" restart when supported)
> /scripts/restartsrv_mysql
> /scripts/restartsrv_mysql --restart
# Stop the service.
> /scripts/restartsrv_mysql --stop
# Perform a hard restart.
> /scripts/restartsrv_mysql --restart --hard

hy i have same cases

need help

Waiting for “mysql” to start ……info [restartsrv_mysql] systemd failed to start the service “mariadb” (The “/usr/bin/systemctl restart mariadb.service --no-ask-password” command (process 20129) reported error number 1 when it ended.): Job for mariadb.service failed because a fatal signal was delivered to the control process. See "systemctl status mariadb.service" and "journalctl -xe" for details.

…info [restartsrv_mysql] systemd failed to start the service “mariadb” (The “/usr/bin/systemctl restart mariadb.service --no-ask-password” command (process 20194) reported error number 1 when it ended.): Job for mariadb.service failed because a fatal signal was delivered to the control process. See "systemctl status mariadb.service" and "journalctl -xe" for details.

…info [restartsrv_mysql] systemd failed to start the service “mariadb” (The “/usr/bin/systemctl restart mariadb.service --no-ask-password” command (process 20263) reported error number 1 when it ended.): Job for mariadb.service failed because a fatal signal was delivered to the control process. See "systemctl status mariadb.service" and "journalctl -xe" for details.

…failed.

Cpanel::Exception::Services::StartError
Service Status

Service Error
(XID xku8g4) The “mysql” service failed to start.

Startup Log
Nov 06 09:23:04 gov.idtelnetwork.com systemd[1]: Starting MariaDB 10.2.28 database server...

mysql has failed. Contact your system administrator if the service does not automagically recover.