1. delimiter
Delimiter is the mysql separator, and the default delimiter In the mysql client is semicolon (;). If many statements are input at a time and there is a semicolon in the middle of the statement, a special separator needs to be specified.
2. Use delimiter
Example of setting a mysql trigger in the previous article
Mysql> delimiter // mysql> create trigger upd_check before update on account-> for each row-> begin-> if new. amount <0 then-> set new. amount = 0;-> elseif new. amount & gt; 100 then-& gt; set new. amount = 100;-> end if;-> end;-> // Query OK, 0 rows affected (0.00 sec) mysql> delimiter;
In the preceding example, the separator is set to //, and the entire statement is executed only when the next // is encountered. After the execution, the last line is delimiter. Set the mysql separator to a semicolon. If this parameter is not modified, all the separators in this session are subject.
Address: http://blog.csdn.net/yonggang7/article/details/24558385