Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a connection to remote Mysql database. (i'm using MySQL Workbench). I'd like to copy whole structure of the database, (without data) to create identical structure on my local machine. Is it possible if I have only username and password to access that database?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

mysqldump -h <host/ip> -d -u <user> -p<password> <database> > export.sql

Note that there is no space between -p and the first character of the password.

share|improve this answer
    
Thanks. Btw, this command downloads all data so I added -d prefix to download only its schema. –  evfwcqcg May 15 '12 at 17:35
    
Sorry, I forgot to add that. I've edited it in to my answer to make it more clear for others who search for this. –  leepfrog May 16 '12 at 0:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.