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
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.