Dump File MySQL 5.6.10

aboliveira picture aboliveira · Mar 5, 2013 · Viewed 82.4k times · Source

I was trying to create a dump file from my MySQL database, but when I try it always gives me this error

Operation failed with exitcode 2

16:06:07 Dumping proactivetraindb (userstate)

Running: mysqldump.exe --defaults-extra-file="h:\docume~1\anarita\locals~1\temp\tmpde5rwy.cnf"  --user=root --max_allowed_packet=1G --host=localhost --port=3306 --default-character-set=utf8 "proactivetraindb" "userstate"

mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_QUOTE_SHOW_CREATE=1' at line 1 (1064)

The version of MySQl is 5.6.10 but the version of MySQLDump is 5.5.16

Does someone know how to solve this?

Answer

Jason Maelstrom picture Jason Maelstrom · May 17, 2013

As outlined by a previous answer, but just to clarify further: This is for MySQL in Windows.

I was having the exact same issue while trying to dump data out of a table on a local test server, and based on the previous answer, this is how I did it.

  1. Find your mysql original download folder, and look in the /bin folder, there should be a mysqldump.exe.
  2. Go into Workbench Preferences: Edit -> Preferences -> Administrator -> Path to mysqldump Tool, and enter in the path to the mysqldump.exe that you found.
  3. Save by pressing "OK" and restarting Workbench.
  4. Open up terminal, but typing in cmd in the Search area of the start menu (Windows 7), and find the sql folder you found in step 1, and cd into bin. It should look like C:\...\bin>. Here, type in mysqldump -t -u [username] -p [database name] [tablename]. This should dump the data from the [tablename] table into the dump folder as designated in Workbench.

Hope this helps!