Wednesday, October 10, 2012

How to import and Export Mysql db

To export mysqlDB:


1.Type the below command to export mysql db:

# mysqldump -u root -p dbname> dbname11092012.sql

To import mysql DB:

1.Go to file location where you saved  backup db and type following command.

 2.login into mysql and create new database.

> create databases newdb

3.exit from sql and type as following

# mysql -u root -p  newdb < db_04102012-0700.sql

[where newdb is newly created db and db_04102012-0700.sql is going to restore newly created db.]

No comments:

Post a Comment