用mysqldump导出Trigger问题解决方法_MySQL
Jun 01, 2016 pm 01:56 PMmysqldump
描述如下:
用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 即可。

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Reduce the use of MySQL memory in Docker

How do you alter a table in MySQL using the ALTER TABLE statement?

How to solve the problem of mysql cannot open shared library

What is SQLite? Comprehensive overview

Run MySQl in Linux (with/without podman container with phpmyadmin)

Running multiple MySQL versions on MacOS: A step-by-step guide

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?

How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)?
