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

很文博客hinven.com 数据库评论88字数 655阅读模式
广告也精彩

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

在执行下面的操作时:文章源自很文博客https://www.hinven.com很文博客-https://www.hinven.com/51117.html

  1. [root@ytt ~]# /usr/local/mysql/bin/mysqldump -S /tmp/mysql1.sock test > test.sql

导出的结果里面含有 Trigger.文章源自很文博客https://www.hinven.com很文博客-https://www.hinven.com/51117.html

  1. [root@ytt ~]# /usr/local/mysql/bin/mysqldump -S /tmp/mysql1.sock -Rdtn test > test_sp.sql

导出的结果里面仍然含有 Trigger.
导入的时候出错:文章源自很文博客https://www.hinven.com很文博客-https://www.hinven.com/51117.html

[root@ytt ~]# /usr/local/mysql/bin/mysql -S /tmp/mysql1.sock --database test < test.sql
[root@ytt ~]# /usr/local/mysql/bin/mysql -S /tmp/mysql1.sock --database test < sp.sql
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'文章源自很文博客https://www.hinven.com很文博客-https://www.hinven.com/51117.html

解决办法:文章源自很文博客https://www.hinven.com很文博客-https://www.hinven.com/51117.html

默认不带任何参数的时候 tiggers 值为真,那么我们修改他的值为假,给mysqldump 加上开关: --triggers=false 即可。文章源自很文博客https://www.hinven.com很文博客-https://www.hinven.com/51117.html 文章源自很文博客https://www.hinven.com很文博客-https://www.hinven.com/51117.html

工具:作品在线观看

女优:最新作品观看

中文:国语在线观看

weinxin
我的微信
扫一扫更精彩
大家的支持是我更新的动力!!!
 
广告也精彩
匿名

发表评论

匿名网友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:
确定

拖动滑块以完成验证