How to create dump in MySQL

Filed in Fedora Core | mysql Leave a comment

FacebookTwitterGoogle+LinkedInTumblrShare

Database: MySQL
Operating System: Linux – Fedora Core 19 (Schrödinger’s Cat)
Architecture: x86_64

Dump basically is a copy of the database in SQL file. It is useful as backup or to reconstruct similar database on different server. Replication normally will get a dump from master database and restore in slave database.

To create a dump.

Approach 1: SSH client, use mysqldump and download through FTP client.

Approach 2: Direct mysqldump from your machine.

By default, mysqldump have –opt options which include –add-drop-table, –add-locks, –create-options, –disable-keys, –extended-insert, –lock-tables, –quick, and –set-charset.

But by default, mysqldump does not include –events and –routines.
–triggers is included by default with each table.
–no-create-db is useful if you plan to load the dump under different database name.
–verbose will output to terminal.

For more information please refer to

, , , ,

How to restore dump in MySQL (nohup version)

Filed in Fedora Core | How-to | mysql Leave a comment

Database: MySQL
Operating System: Linux – Fedora Core 19 (Schrödinger’s Cat)
Architecture: x86_64

Normally, you will maintain remote database server through SSH client.
Large database dump require long time to restore (few hours).
Disconnect SSH client from remote database server will kill the running process.
Leaving the terminal open until restore the dump completed meaning leaving laptop overnight at office.
Nohup approach allow the process to continue running even if SSH client disconnect from remote server.

, , , ,

TOP