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
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.
/bin
folder, there should be a mysqldump.exe
. Edit -> Preferences -> Administrator -> Path
to mysqldump Tool, and enter in the path to the mysqldump.exe that you found.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!
For Mac it depends on your installation.
If you used a dmg file to install it, you need to find the bin directory.
mine was under /usr/local/mysql/bin
You will find mysqldump file under this folder.
Now provide this location in your
Preferences -> Administrator -> Path to mysqldump Tool as /usr/local/mysql/bin/mysqldump
You should be good to export now.
If you are on Linux, update mysql-client to latest version. On Ubuntu:
sudo apt-get upgrade mysql-client
did the job for me.
Setting up mysql-client-5.5 (5.5.43-0ubuntu0.12.04.1) ...
Mine got updated to 5.5 and mysqldump now works for me. This is on Amazon RDS with MySQL 5.6.x
I have Mysql 5.6.12 version. SET SQL_QUOTE_SHOW_CREATE=1
is working fine in my machine.
now i am able to take a dump of sql.
mysql> SET SQL_QUOTE_SHOW_CREATE=1; Query OK, 0 rows affected (0.00 sec)
worked for me.
For compatibility, I needed MySQL 5.6.41
on my Windows 10 machine, so I used the 5.6.41 MySQL installer
to install "All" (My Workbench, MySQL, connectors, etc).
Even though I used the installer for version 5.6.41, it installed Workbench 8.0
, as well as version 8.0 of the various connectors, etc.
So of course, I got a similar error.
There seems to be no easy way to force lower version of MySQL Workbench to be installed instead (On my previous machine, before workbench 8.0, did NOT have this conflict when installed).
Solution that worked for me:
Find the version of mysqldump.exe
that matches the version of MySQL you're using:
mysqldump.exe
mysqldump.exe
it found -> Properties
-> Details
tab. 5.6.41
(matching the MySQL version I'm running) Clicked back to the General
tab, to see the folder path that that version of mysqldump.exe was installed in
C:\Program Files\MySQL\MySQL Server 5.6\bin
, in my case
(version 8.0 was installed in C:\Program Files\MySQL\MySQL Workbench 8.0 CE
)
Now open MySQL Workbench..
Edit -> Preferences -> Administration -> Path to mysqldump Tool
Paste in the file path for the appropriate version of mysqldump.exe
(including the file name!)
Click OK
Restart MySQL Workbench
This worked for me. However, I have no idea how to make this work if you have two versions of MySQL on your machine, say MySQL 5.6 and 5.7, or 8.0.
So when I upgrade (any/some/all of) my cloud servers to version 5.7, this looks to be another challenge to overcome. Since Workbench only allows a single mysqldump.exe
file, to be used no matter which version of my local MySQL server is running... Or perhaps manually change the path location, each time open a connection that uses the Port to the other MySQL version (and remember to change it back after?).
For this reason, I Removed
MySQL 5.7 completely, and will hence keep all cloud (and my local) servers at 5.6 for the time being - a Project for another day.
In Workbench look for Preferences: Edit -> Preferences -> Administrator -> Path to the mysqldump Tool. Browse your MySQL folder inside the bin folder and look for mysqldump.exe.