Simple bash script to check mysql status with Nagios

After updating mysql on a server that is running cpanel, Nagios kept reporting that mysql is down. I double checked and the database server was running just fine, so I proceeded with a step by step analysis, the issue proved to be the following:

root@cpanel [~]# /usr/local/nagios/libexec/check_mysql
/usr/local/nagios/libexec/check_mysql: error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory

Read more

How to fix MySQL import Error: Duplicate entry at line

If while importing a database you encounter the following error mysql example < example.db Error: Duplicate entry at line: XXX just redump the database from the original source with the –insert-ignore option: mysqldump –insert-ignore –single-transaction example > example.db You should now be able to import the dump without any issue and you will no longer …

Read more