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
If you're on a linux machine, this is provided by the mysql-client
package. Installing that fixed the problem for me.
You are probably using Amazon RDS, right? You can just get the newer version of mysqldump, v5.6 and use it instead.
Download the portable zip here and extract just the mysql\mysqldump.exe there. http://sourceforge.net/projects/xampp/files/XAMPP%20Windows/1.8.3/
I tried it just now and it worked fine for me.
The reason for this is that MySQL 5.6 has removed support for "SET OPTION" and your mysql client tools are probably on older version. Most likely 5.5 or 5.1. There is more info about this issue on MySQL bugs website.
The quickest solution is to update your mysql client tools to 5.6 and your problem will be solved. If you are on Linux platform, here is a solution that worked great for me: http://www.markomedia.com.au/mysqldump-mysql-5-6-problem-solved/
I had this problem on the Amazon EC2 acessing a RDS Mysql 5.6 database. I just ran
sudo apt-get upgrade
It didn't update mysql client to 5.6, but mysqldump now is working fine.
I just had the same problem and I put a couple of different answers together.
The pro for me was, that I could switch easily between 5.6, 8, ... without having to up/downgrade ubuntu dependencies each time.
The easiest way for me on Ubuntu was to just download the 5.6 (or 5.7, whatever you want) mysqldump binary and change that in workbench. Everything went well after that:
{{YOUR_UNPACKED_FOLDER}}/bin/mysqldump
Ok
Now you should be able to just export and it will use mysqldump 5.x.
I had the same error in MySQL Workbench.
It should work.