cancel
Showing results for 
Search instead for 
Did you mean: 

Database export

SOLVED

Database export

I would like to know that how can i export magento db as a sql file.I am getting error while trying the export option in phpmyadmin.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Database export

Hello @neeraja14n941e 

 

To export full database, we make use of:
mysqldump --user=root --password= --host=localhost --compress --disable-keys --quick [db_name] > export.sql

In case you need to export specific tables, use the following command:
mysqldump --user=root --password= --host=localhost --compress --disable-keys --quick [db_name] [Space separated Table Names] > export.sql

Let's say if we want to export the following table named "salesrule":

salesrule
salesrule_coupon
salesrule_coupon_usage
salesrule_customer
salesrule_customer_group
salesrule_label
salesrule_product_attribute
salesrule_website

Then run the command below:
mysqldump --user=root --password= --host=localhost --compress --disable-keys --quick magento1937 salesrule salesrule_coupon salesrule_coupon_usage salesrule_customer salesrule_customer_group salesrule_label salesrule_product_attribute salesrule_website > export_salesrule_tables.sql

View solution in original post

1 REPLY 1

Re: Database export

Hello @neeraja14n941e 

 

To export full database, we make use of:
mysqldump --user=root --password= --host=localhost --compress --disable-keys --quick [db_name] > export.sql

In case you need to export specific tables, use the following command:
mysqldump --user=root --password= --host=localhost --compress --disable-keys --quick [db_name] [Space separated Table Names] > export.sql

Let's say if we want to export the following table named "salesrule":

salesrule
salesrule_coupon
salesrule_coupon_usage
salesrule_customer
salesrule_customer_group
salesrule_label
salesrule_product_attribute
salesrule_website

Then run the command below:
mysqldump --user=root --password= --host=localhost --compress --disable-keys --quick magento1937 salesrule salesrule_coupon salesrule_coupon_usage salesrule_customer salesrule_customer_group salesrule_label salesrule_product_attribute salesrule_website > export_salesrule_tables.sql