1. 程式人生 > >解決MysqlWorkbench Export Data時報錯:'delayed-insert'=FALSE

解決MysqlWorkbench Export Data時報錯:'delayed-insert'=FALSE

MysqlWorkbench Export Data時報錯

問題

MysqlWorkbench6.0之後的版本使用export data時會遇到這個錯誤
Running: /Applications/MySQLWorkbench.app/Contents/MacOS/mysqldump --defaults-file
="/var/folders/xl/s140j_d96n5djybp3rvh2nt80000gp/T/tmpn6fxeU/extraparams.cnf"  
--set-gtid-purged=OFF --delayed-insert=FALSE --host=121.40.157.75 
--protocol=tcp --user=root --port=3306
--default-character-set=utf8 --skip-triggers "matchbox_test" mysqldump: [ERROR] unknown variable 'delayed-insert=FALSE' Operation failed with exitcode 7 13:19:01 Export of /Users/jason/Documents/Dump20151116.sql has finished with 1 errors

原因

我們看錯誤報告顯示這個變數 'delayed-insert=FALSE' 不被識別,workbench預設配置裡會開啟
這個變數並且預設值是false。如果我們用不到這個變數可以更改配置檔案,註釋掉這個變數來解決

解決步驟

  • 找到配置檔案目錄:__InstallPath__/modules
  • 開啟python格式的輸出配置檔案:wb_admin_export_options.py
  • 找到所在行:"delayed-insert":["Write INSERT DELAYED statements rather than ...
  • 在行開頭插入#號註釋改行
  • 儲存檔案,重啟Workbench

配置檔案所在位置

windows

Workbench的安裝目錄
如:C:\Program Files\MySQL\MySQL Workbench 6.3 CE\modules

Mac

Applications -> MYSQLWorkbench.app
/Contents/Resources/plugins. Note: 在應用上右擊選擇 Show Package contents 進入應用目錄

Ubuntu

/usr/lib/mysql-workbench/modules/wb_admin_export_options.py