Amazon

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

TOGAF 9.2 - STUDY [ The Open Group Architecture Framework ] - Chap 01 - Introduction

100 Feet View of TOGAF  What is Enterprise? Collection of Organization that has common set of Goals. Enterprise has People - organized by co...