2

I have created a database using MySQL command line client. All database files in *.frm format. Now I want to create a *.sql file from tables of this database. How to do this ? I have fond some similar questions here and none of the solutions provided worked for me.

Grant
  • 4,413
  • 18
  • 56
  • 82
  • Are you attempting to recover your database from your `.frm` files, or you just want `.sql` files created? If the latter, check out [`mysqldump`](http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html). If the former, then this is a duplicate of http://stackoverflow.com/questions/879176/how-to-recover-mysql-db-from-myd-myi-frm-files – newfurniturey Aug 22 '12 at 12:00
  • @newfurniturey Thanks for the information. I just wanted to export my database as a *.sql file and I did it as Mihai Iorga said. :) – Grant Aug 22 '12 at 14:53

3 Answers3

3

mysqldump

mysqldump -uroot -p database > /path/to/file/database.sql

where root is username and you will be prompted for password, database is database name

Mihai Iorga
  • 39,330
  • 16
  • 106
  • 107
  • 1
    Thanks for the answer. First we need to change the directory to MySQL>>bin then we can run mysqldump – Grant Aug 22 '12 at 14:55
0

Use mysqldump to export the database.

mysqldump MyDatabase > MyDatabase.sql

http://dev.mysql.com/doc/refman/5.5/en/mysqldump.html

Ed Manet
  • 3,118
  • 3
  • 20
  • 23
  • Where I need to execute these command?? In windows command prompt or MySQL command line client ?? I tried to execute this in MySQL command line client and it gives a syntax error. Thanks! – Grant Aug 21 '12 at 13:20
0

Select your table whose .sql file you want to create -> then click on Export -> then press Go. .SQL file of that table will be created

saket
  • 1