Monday, November 16, 2009

Import/Export data using dump file in MysQL

Create a dump file of a table:
mysqldump -c -u user -ppassword database tabel > filename.sql

(no space after p and password)

Push the data of dump file into MySQL database
mysql --verbose --user=XXXXXXXX --password=XXXXXXXX DB_NAME < /PATH/TO/DUMPFILE.SQL

Both these commands need to run from the command prompt and on the machine hosting the database.

No comments:

Post a Comment