Starting MySQL.190925 12:20:00 mysqld_safe Logging to '/var/log/mysqld.log'.  ERROR!

  • KM03599565
  • 13-Feb-2020
  • 13-Feb-2020

This document has not been formally reviewed for accuracy and is provided "as is" for your convenience.

Summary

These steps could be followed when sql database is not starting leading to awaiting activation on the management console.

Error

When the command service mysql status is ran, the output shows :

Starting MySQL.190925 12:20:00 mysqld_safe Logging to '/var/log/mysqld.log'.

 ERROR!

 

or service mysql status

 ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists

 


 

 

Cause

This can be caused when database suddenly crashes/stops running or was abrupblty shutodwn or rebooted.

Other causes can be network issues, steps not followed correctly during the upgrade proces.

 

The probable reason if the steps provided soesn't work then the logs can be checked for the detailed information about the error:

 

file /var/log/mysqld.log

Fix

For databases, a lock files is created when the services are running or it did not stop properly/ or shut down unexpectedly.

Step 1.

* try to kill the process, by entering the command:   service mysql stop

* check the status, command:   service mysql status

* If it has stopped, go to the following path:

* cd /var/lock/subsys/mysql

* If the lock file ie mysql exists, delete it.

* To delete; run the command:  rm mysql

* service mysql restart

this should solve the problem.

 

If it doesn't then:

Step 2. 

1) Connect to the appliance commandline (as root).
2) Edit /etc/my.cnf file
3) In the [mysqld] section, add the following line: innodb_force_recovery=2

For example:
[mysqld]
innodb_data_file_path = ibdata1:10M:autoextend
innodb_buffer_pool_size=1536M
innodb_log_file_size=192M
innodb_additional_mem_pool_size=30M
innodb_log_buffer_size=8M
query_cache_size=32M
read_buffer_size=2M
thread_cache_size=8
innodb_thread_concurrency=4
net_read_timeout=1800
net_write_timeout=1800
wait_timeout=1800
max_allowed_packet=100M
max_connections=200
expire_logs_days=99
innodb_file_per_table
character_set_server=utf8
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
innodb_force_recovery=1

4) Save changes and restart mysql: service mysql restart
5) Wait a few minutes, then remove the innodb_force_recovery=2 setting and restart mysql again (same command as before).
6) Please reboot the system after making these changes.

Update the cluster after checking the service status.