Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 567
Erick Amezcua Avatar asked Jan 21 '21 15:01

Erick Amezcua


3 Answers

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

like image 90
magallanes Avatar answered Oct 22 '22 02:10

magallanes


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

like image 20
RodriT91 Avatar answered Oct 22 '22 02:10

RodriT91


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")
like image 30
cl0ne Avatar answered Oct 22 '22 03:10

cl0ne