简体   繁体   中英

MySQL Workbench: including triggers in creation script

I'm using forward engineering to save a script that creates my database, but I also have some triggers that I want included in that. Thing is, triggers are defined in the Schema tab while forward engineering is done in the Model tab.

I need to be able to send the whole database creation script to someone so they can create it on their end. I know how to apply triggers to the database on my end, but I don't know how to include them in the creation script besides just sending the trigger scripts separately.

Is it as simple as putting the trigger statements at the end of the database creation script (generated by forward engineering)?

you dump database using -

To dump all databases, invoke mysqldump with the --all-databases option:

mysqldump --all-databases > dump.sql

Here's the command to dump the triggers and stored procedures for a database:

mysqldump --routines --no-create-info --no-data --no-create-db --skip-opt [dbname]

hope its helpful to you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM