Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Databse Creation Script

Status
Not open for further replies.

jake007

Programmer
Jun 19, 2003
166
US
When creating a database schema in sql Server, using the visual data manager, after creating the table you can generate a script file which can be run to generate the same table automatically on another server. Is it possible to do this in MYSQL as well

Jake
 
Sure, do a "SHOW CREATE TABLE tblname" query, save the output to a file, and execute the file on the other server.
 
You can also run a myslqdump command on the command prompt, and it will a create a text file that contains all the command to recreate the table, and reinsert any data it had.

mysqlManual said:
The [green]mysqldump[/green] client can be used to dump a database or a collection of databases for backup or for transferring the data to another SQL server (not necessarily a MySQL server). The dump contains SQL statements to create the table and/or populate the table.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top