Tag Archives: mysql

Check MySQL service with nagios.

I was surprised that nagios plugins didn’t come with a pre-packaged check_mysql command! Anyway, here is a quick way to do it. Add the command definition in command.cfg. define command{ command_name check_mysql command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 3306 } Add the service definition to an existing host. define service{ use local-service host_name gnucom.cc service_description MYSQL [...]
Posted in Nagios, Webhosting | Also tagged | Leave a comment

Backup or restore MySQL database via SSH or terminal.

Here is the command to use to actually backup the database on the command line: mysqldump --add-drop-table -u user -p database > database.sql When you have the backup, use this command to restore it: mysql -u user -p database < database.sql You need to make the appropriate substitutions obviously. Hope this is brief enough!
Posted in Programming, Webhosting | Also tagged , , | Leave a comment