Backing Up MySQL

Navigation:  MySQL Governor >

Backing Up MySQL

Previous pageReturn to chapter overviewNext page

On cPanel server disable MySQL service monitoring before doing the job:

 

$ whmapi1 configureservice service=mysql enabled=1 monitored=0

 

Execute as root:

 

$ mkdir -p ~/mysqlbkp

$ service mysql restart --skip-networking --skip-grant-tables

$ mysql_upgrade

$ mysqldump --all-databases --routines --triggers > ~/mysqlbkp/dbcopy.sql

$ service mysql stop

$ cp -r /var/lib/mysql/mysql ~/mysqlbkp/

$ service mysql start

 

On cPanel server enable monitoring back:

 

$ whmapi1 configureservice service=mysql enabled=1 monitored=1

 

Note that this operation may take some time.