Generate Change Script for MySQL Modifications
After reading a blog post called “Generate Change Script for SQL Modifications” for MSSQL Management Studio, we wanted to show how to do this same task for MySQL using the MySQL Query Browser.
- Open the Query Browser and right click on the table you need to modify.
- Select Edit Table from the context menu. You will be presented with the MySQL Table Editor. This gives you a graphical interface for modifying your table structure.
- Modify the table in whatever way you wish.
Some examples…
- change field names, types, defaults
- add indices, foreign keys
- change the character sets and collation
- change the auto increment value - Click Apply Changes at the bottom of the window. You will be presented with a confirmation box. CHANGES HAVE NOT BEEN EXECUTED YET. What’s great is that it gives you the code that it will use to modify the table.

- Use your cursor to select the code and then copy it into whatever text editor you prefer.
Now you have a sql script that can be executed on multiple servers, or further modified by hand.






October 3rd, 2008 at 2:21 am
Hi,
Above discussion is looking good . but i need script file for table without editing after creation of table in mysql query browser .can you help me to create above discussed script file