Is it possible to extract a script from an MySQL database to create a copy of the tables on another MySQL database which is located on a remote server?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can dump either the structure of the tables, or their content, using the
mysqldumpcommand-line tool.For example, to get a dump of the structure (
create tableinstructions) of all tables of a database, you can use something like this :And, to get this to a file, instead of getting it to the standard output, you can redirect that output :
If you also want the data of the tables, and not just their structure, do not use the
--no-dataoption.Then, on your other server, you can import the dump, using :