Way to fix MySQL down but running as mysqld_safe

Way to fix MySQL down but running as mysqld_safe

MySQL got down now! You would received a statement from WHM and cPanel.

Code:
# /usr/local/cpanel/scripts/restartsrv_mysql --status (XID l35tte) The “mysql” service is down.
But still, you are running with mysqld_safe till now:

Code:
# ps fauxww | grep mysq[l] root 1030 0.0 0.1 113632 1593 ? S 12:31 0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/host.hostname.tld.pid mysql 1134 0.0 8.7 1305384 88427 ? Sl 12:31 0:01 \_ /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/host.hostname.tld.err --open-files-limit=10000 --pid-file=/var/lib/mysql/$hostname.pid
You can use mysqld_safe for restarting the MySQL again after the down. You have got an error so, now restarting the MySQL so that, new features will be added for your safety precaution.

Still, MySQL indicates an error. Be careful with your next step.

Check the MariaDB version in EL7 which ranges between 10.4.4 and 10.1.7. It might lead to some issues where systmed and init script have a race condition. At the same time, mysqld_safe helps to get restarted with MySQL but that’s a bad idea. Somehow, we’ll try to manage the situation with all alternatives.

Check with the following command that MariaDB is enabled or not

Code:
systemctl enable mariadb
Try with this example:

Code:
# systemctl enable mariadb Created symlink from /etc/systemd/system/mysql.service to /usr/lib/systemd/system/mariadb.service. Created symlink from /etc/systemd/system/mysqld.service to /usr/lib/systemd/system/mariadb.service. Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
Now, stop with MySQL and do restartsrv script restart again:

Code:
/usr/local/cpanel/scripts/restartsrv_mysql --stop /usr/local/cpanel/scripts/restartsrv_mysql –start
You will not get errors from now onwards!
Author
kumkumsharma
Views
1,428
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from kumkumsharma

Top