Hey there! any question in your mind? Ask It Now!.

Popular Categories





MySQL-Export schema without table data.

+1 vote
76 views
asked in Programming by Nitesh singh

I have a database in different server now I have to export table schema and also have to download it in my local .

If possible, please let me know the command for exporting table with data also.

1 Answer

+1 vote
answered by Himanshu Expert (5,940 points)
selected by Bhartesh
 
Best answer

You can use  --no-data option with mysqldump see


mysqldump -u root -p --no-data dbname > schema.sql

 

For backup use :  mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql  

 

For restore use : mysql -u root -p[root_password] [database_name] < dumpfilename.sql

 

Now you can do scp to your local like this :

 

scp user@serverip:/home/user/schema.sql .     (If using windows so please execute these commands on putty.) 

I hope it helped you! 

Related Questions

+1 vote
2 answers 4,750 views
+2 votes
1 answer 88 views
+12 votes
1 answer 108 views
+3 votes
1 answer 348 views
0 votes
1 answer 103 views

Not a Member yet?

Ask to Folks Login

My Account
132 Folks are online
0 members and 132 guest online
Your feedback is highly appreciated