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

Popular Categories

MySQL-Export schema without table data.

+1 vote
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 [email protected]:/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 6,544 views
+8 votes
1 answer 245 views
+2 votes
1 answer 205 views
+12 votes
1 answer 239 views
+3 votes
1 answer 580 views
0 votes
1 answer 187 views

Not a Member yet?

Ask to Folks Login

My Account
348 Folks are online
2 members and 346 guest online
Your feedback is highly appreciated