TheDataGirl

A little blog about big data and other things
mysql

MySQLDump options

The mysqldump command is used to dump data and structures from MYSQL databases.

The basic command asks for a username, password, database and the file name of the script which will contain all of the statements in the dump file script.

Basic command:

Mysqldump –u<user> –p database_name > extract_file.sql

Here are a list of the most frequently used MySQLDump options you can add:

–databases

This option means that what will be following is a list of database names.

e.g. mysqldump –uroot –p –databases person > extract_file.sql

–debug

The–debug option means that the output will be logged to a debugging log file

–no-autocommit

This option means that after inserting statements, they will not be automatically committed.

–no-data

The –no-data option allows the dumping of the structure of tables and objects, without dumping any data

–routines

Dumps functions and procedures

–skip-add-drop-table

Does not include statements to DROP TABLE

 –skip-opt

This option disables all other options.

–tables

Expects a list of tables to follow

–where

This option means that only if the where condition is met, will the data be extracted

To read the extensive list of mysqldump options, check out this link: https://dev.mysql.com/doc/refman/5.5/en/mysqldump.html

Leave a Reply

Your email address will not be published. Required fields are marked *