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.

2
  • Are you attempting to recover your database from your .frm files, or you just want .sql files created? If the latter, check out mysqldump. If the former, then this is a duplicate of stackoverflow.com/questions/879176/… Commented Aug 22, 2012 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. :) Commented Aug 22, 2012 at 14:53

3 Answers 3

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the answer. First we need to change the directory to MySQL>>bin then we can run mysqldump
0

Use mysqldump to export the database.

mysqldump MyDatabase > MyDatabase.sql

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

1 Comment

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!
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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.