I have a table with over 100 rows which I'd like to be able to recreate on other servers. Using create_table and manually entering each row as an argument will take a long time as you can imagine. Is there a quick way for generating a prepopulated create_table statement for on an already existing table? Thanks.
This may not be the best idea, but this is what I do. Take a backup of mysql. Copy the "insert" query in a mysql_query() statement and paste in installer. regards
**BACKUP YOUR DATABASES** (mysqldump yourdatabase > yourdatabase.sql) To get a table from one server to another... On server A: mysqldump yourdatabase yourtable > yourtable.sql Code (markup): on server B: mysql -uroot -p yourdatabasename < yourtable.sql Code (markup): If the table doesn't exist in 'yourdatabasename' on server B, it will be created. If the table already exists on server B, you can edit the yourtable.sql file and remove the lines for table creation and just leave the lines with the INSERTs, i.e. something like: grep INSERT yourtable.sql > yourtable1.sql && mv yourtable1.sql yourtable.sql mysql -uroot -p yourdatabasename < yourtable.sql Code (markup): It would be a good idea to familiarize yourself with the file 'yourtable.sql' before you actually execute anything anyway since it might have a "DROP yourtable IF EXISTS" statement in it, etc... HTH