Home  >  Article  >  Database  >  运用mysqldump 工具时需要注意的问题

运用mysqldump 工具时需要注意的问题

WBOY
WBOYOriginal
2016-06-07 18:01:32997browse

用mysqldump 导出 Trigger 的时候遇到一个问题,贴出来,以免大家犯错。

描述如下:
用mysqldump 导出 Trigger 的时候遇到一个问题,贴出来,以免大家犯错。

在执行下面的操作时:
代码如下:
[root@ytt ~]# /usr/local/mysql/bin/mysqldump -S /tmp/mysql1.sock test > test.sql

导出的结果里面含有 Trigger.
代码如下:
[root@ytt ~]# /usr/local/mysql/bin/mysqldump -S /tmp/mysql1.sock -Rdtn test > test_sp.sql

导出的结果里面仍然含有 Trigger.
导入的时候出错:

[root@ytt ~]# /usr/local/mysql/bin/mysql -S /tmp/mysql1.sock --database test [root@ytt ~]# /usr/local/mysql/bin/mysql -S /tmp/mysql1.sock --database test ERROR 1235 (42000) at line 26: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'


解决办法:

默认不带任何参数的时候 tiggers 值为真,那么我们修改他的值为假,给mysqldump 加上开关: --triggers=false 即可。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn