0

Hi All,

I am using MySql and wrote all my create table scripts directly on the command line client. Now I have no tracks of them. I need all the table scripts present in my database region for future reference. I used the below command to view the script of one of my table :

show create table tablename;

It displays the script for tablename. Can Anybody guide me in collecting all the scripts present in the region, into one file?

3
Contributors
8
Replies
9
Views
7 Years
Discussion Span
Last Post by nitin_gyan
0

Mysql comes with a command line tool called mysqldump . You can use it to export your tables and/or data into an .sql file.

0

Hi pritaeas,

Thanks for ur help.

I checked this command but its not working. where this file will be created? Is there any pre-requisite ?? suppose my database name is "DBase" and it has 2 tables A and B. How should I use the command so as to get the script of these tables into an output file.

0

Sorry pritaeas,

:(

Nothing is working. I tried everything but its showing syntax error.

0

Hello,

Try:

mysqldump -u root -p DBase > outfile.sql

it will prompt you for the root password and create a file in the current directory called outfile.sql

0

Hi,

I tried this code. To end the command I gave ';' and it gave me syntax error.

Attachments mysqldump.jpg 54.11 KB
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.