Saturday, May 5, 2012

Exporting mysql Database to .sql file

Exporting DB 
Taking dump of all tables of a Database. For Example - DB name is development_studio

C:\>mysqldump --single-transaction -u sanjeev -p development_Studio > dump.sql
Enter password: *******

--single-transaction option is above command make sure that taking dump does not give TABLE LOCK error. For example

>mysqldump  -u sanjeev -p development_Studio > dump.sql
Enter password: *******
mysqldump: Got error: 1044: Access denied for user 'sanjeev'@'localhost' to database 'development_studio' when using LOCK TABLES

Another option is to grant LOCK TABLES to your user:
c:\>mysql -u root -p

mysql> GRANT SELECT,LOCK TABLES ON DBNAME.* TO 'username'@'localhost'; 

No comments:

Post a Comment

Amazon Best Sellors

Weblogic - Server Creation - Issues

Datasource creation using python script.  Python Script was failing after creating Datasource. From UI Admin Console, if I try to activat...