触发事件执行

mysql -vvv -u root -p123456 test -e "truncate t_target;alter event ev1 on schedule at current_timestamp enable;alter event ev2 on schedule at current_timestamp enable;alter event ev3 on schedule at current_timestamp enable;alter event ev4 on schedule at current_timestamp enable;"
        该命令行顺序触发了4个事件,但不会等前一个执行完才执行下一个,而是立即向下执行。这可从命令的输出可以清除看到:

[mysql@hdp2~]$mysql -vvv -u root -p123456 test -e "truncate t_target;alter event ev1 on schedule at current_timestamp enable;alter event ev2 on schedule at current_timestamp enable;alter event ev3 on schedule at current_timestamp enable;alter event ev4 on schedule at current_timestamp enable;"
mysql: [Warning] Using a password on the command line interface can be insecure.
--------------
truncate t_target
--------------

Query OK, 0 rows affected (0.06 sec)

--------------
alter event ev1 on schedule at current_timestamp enable
--------------

Query OK, 0 rows affected (0.02 sec)

--------------
alter event ev2 on schedule at current_timestamp enable
--------------

Query OK, 0 rows affected (0.00 sec)

--------------
alter event ev3 on schedule at current_timestamp enable
--------------

Query OK, 0 rows affected (0.02 sec)

--------------
alter event ev4 on schedule at current_timestamp enable
--------------

Query OK, 0 rows affected (0.00 sec)

Bye
[mysql@hdp2~]$
---------------------

posted on 2019-08-06 19:24  激流勇进1  阅读(108)  评论(0编辑  收藏  举报