# Access the database using --comments -bash-4.2$ mysql -u root -pmsandbox --socket=/tmp/mysql_sandbox5724.sock --comments test mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.7.24 MySQL Community Server (GPL) Copyright (c) 2009-2018 Percona LLC and/or its affiliates Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select @@version ; +-----------+ | @@version | +-----------+ | 5.7.24 | +-----------+ 1 row in set (0.00 sec) mysql> use test ; Database changed mysql> CREATE TABLE t1 (c1 integer); Query OK, 0 rows affected (0.00 sec) mysql> CREATE TABLE t2 (c1 integer); Query OK, 0 rows affected (0.00 sec) mysql> CREATE TABLE t3 (c1 integer); Query OK, 0 rows affected (0.01 sec) # Create a trigger with two comments in the same line mysql> DELIMITER ;; mysql> CREATE TRIGGER trigger_test_case AFTER INSERT ON t1 FOR EACH ROW BEGIN /* INSERT T2 */ insert into t2 (c1) values (NEW.c1) ; /* INSERT T3 */ insert into t3 (c1) values (NEW.c1) ; END ;; Query OK, 0 rows affected (0.00 sec) mysql> DELIMITER ; mysql> show triggers \G *************************** 1. row *************************** Trigger: trigger_test_case Event: INSERT Table: t1 Statement: BEGIN /* INSERT T2 */ insert into t2 (c1) values (NEW.c1) ; /* INSERT T3 */ insert into t3 (c1) values (NEW.c1) ; END Timing: AFTER Created: 2019-02-08 16:28:56.96 sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION Definer: root@localhost character_set_client: utf8 collation_connection: utf8_general_ci Database Collation: latin1_swedish_ci 1 row in set (0.00 sec) mysql> exit Bye # Dump all test database including triggers - triggers are correctly exported -bash-4.2$ mysqldump -u root -pmsandbox --socket=/tmp/mysql_sandbox5724.sock test --triggers --routines --events > test_case.sql mysqldump: [Warning] Using a password on the command line interface can be insecure. # Import all test database without using --coments flag -bash-4.2$ mysql -u root -pmsandbox --socket=/tmp/mysql_sandbox5724.sock test < test_case.sql mysql: [Warning] Using a password on the command line interface can be insecure. # The code part until the second comment is lost mysql> show triggers \G *************************** 1. row *************************** Trigger: trigger_test_case Event: INSERT Table: t1 Statement: BEGIN insert into t3 (c1) values (NEW.c1) ; END Timing: AFTER Created: 2019-02-08 16:30:31.97 sql_mode: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION Definer: root@localhost character_set_client: utf8 collation_connection: utf8_general_ci Database Collation: latin1_swedish_ci 1 row in set (0.00 sec)