Backing up Clientexec with straight MySQL code

  • June 20, 2014
  • 0 Comments

phpMyAdmin can not handle large databases so using straight MySQL code will help.

1. Change your directory to the directory you want to dump things to:

user@linux:~> cd CE_backup/

2. Use mysqldump (man mysqldump is available):

user@linux:~/CE_backup> mysqldump --add-drop-table -h mysqlhostserver
-u mysqlusername -p databasename (tablename tablename tablename) | bzip2
-c > ClientExec.bak.sql.bz2

Enter password: (enter your mysql password)
user@linux~/CE_backup>

Example:
mysqldump --add-drop-table -h db01.example.net -u dbocodex -p dbwp | bzip2 -c > ClientExec.bak.sql.bz2

Enter password: my-password
user@linux~/CE_backup>

The bzip2 -c after the | (pipe) means the backup is compressed on the fly. It does in one line the same thing that these two commands do:

mysqldump --add-drop-table -h DB.example.net -u dbocodex -p dbwp > ClientExec.bak.sql
bzip2 ClientExec.bak.sql

How helpful was this article to you?