Search Marketing


Backing Up Table Data in MySQL - Database Dump to Text File

Fri May 02, 2008 9:53 pm
Comments: 1 Views: 1932

MySQL offers many ways to save and backup your database. One of the easiest ways is to use the DUMP command. The output is a text file that contains the actual insert and create command to restore the tables and data. Keep in mind that the data source files are not saved during this process.

The data source files are usually located in /var/lib/mysql/database_name, or something similar.

This command runs in the shell and not in mysql.

# mysqldump -uname -p database_name > database_name.sql

To run the file database_name.sql back into MySQL you just reverse the command. Do not forget to take off the DUMP part of the line.

# mysql -uname -p database_name < database_name.sql

Note: the database must exist before you can run the command.

mysql > create database name;

Mon Sep 15, 2008 10:48 pm
Name: Karlis | Comment: Thanks!

URL: http: (ex.
Math (16 + 5)
* required

© 2017 Christonium LLC
Terms of Use