Error executing task write() argument must be str, not bytes | MySQL Workbench

Viewed 14772

After a clean install of Windows 10 when I started to use MySQL workbench I have this error when I try to dump a database.

I could not find anything about it anywhere, the only thing I find are problems with phyton, but nothing related with Workbench.

Output after dumping a database:

08:29:00 Dumping foo(all tables)
Error executing task write() argument must be str, not bytes
08:29:01 Export of b'C:\\Users\\erick\\Documents\\dumps\\Dump20210121 (2).sql' has finished

And the output file is in blank, some ideas?

4 Answers

You can disable (uncheck) the option create schema. It is annoying but it works.

If you have the latest MySQL Workbench (8.0.23), just uninstall and install MySQL Workbench 8.0.20. That worked for me.

Another workaround to this issue is to edit wb_admin_export.py.

In dump_to_folder (line 1679) replace

self.out_pipe = open(path,"w")

with

self.out_pipe = open(path,"wb")

In dump_to_file (line 1957) replace

self.out_pipe = open(self.path,"w")

with

self.out_pipe = open(self.path,"wb")

If you a using version 8.0.23, update to 8.0.25 or above.... it will fix this issue

Related