MySQL Data Backup Commands


mysql
MySQL Data Backup For Users Converting To Normal Text
SELECT * FROM table_name INTO OUTFILE ‘/tmp/tutorials.csv’;

Exporting Tables As Raw Data
mysqldump -u root -p –no-create-info  –tab=/tmp DATABASE table_name;

Backup For All Databases
mysqldump -u root -p –all-databases > database_dump.sql

Copying Database to Another Host
mysqldump -u root -p database_name  | mysql -h other-host.com database_name

Importing Data With Load Data
LOAD DATA LOCAL INFILE ‘dump.txt’ INTO TABLE mytbl;

Importing Data With MySQLImport
mysqlimport -u root -p –local database_name file_name

How To Backup Multiple MySQL Databases Into a Single File
mysqldump -u [username] p[password] all-databases > [dump_file.sql]

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s