To generate a script from a diagram in MySQL Workbench:
- Select File > Export > Forward Engineer SQL CREATE Script...
- Enter a location to save the file (optional) and set options to include on the script (such as DROP statements etc), then click Continue
- Exclude any objects by deselecting them, otherwise leave them as is, then click Continue
- The script is generated. You can copy it to your clipboard or click Finish to save it to a file