MySQL Forums
Forum List  »  General

Running mysqldump on windows 10
Posted by: Daniel Schwartz
Date: August 19, 2018 07:48PM

I'm running MySQL 5.7.13 64-bit version. On Windows 7 everything works fine. But on Windows 10 the mysqldump operation inserts null characters immediately before each non-null character in the dump file. This then makes it impossible to import the dump file back into any MySQL database. Attempting to do so gives the message:

ERROR:
ASCII '\0' appeared in the statement, but this is not allowed unless option --binary-mode is enabled and mysql is run in non-interactive mode. Set --binary-mode to 1 if ASCII '\0' is expected. Query: ' ¦-'.

which turns out to be useless.

I discovered the problem when I noticed that the dump file created on Windows 10 was about twice as large as the one created on Windows 7, even though when you open the two files in either MS Notepad or MS Wordpad, they look identical. To get a better look at the files I copied them to a Linux machine and opened them in Emacs. This showed that the dump file contained the null characters as described above, whereas no such characters appear in the dump file created on Windows 7. The null characters show up in Emacs as "^@".

I was able to remove these on the Linux machine using the command

tr -d '\000' < originalDumpfile > newDumpFile

This left two other strange characters looking like "ÿþ" at the beginning of the newDumpFile, which I also deleted. The resulting newDumpFile could then be imported into a MySQL database on either the Windows 10 or the Windows 7 machines using the usual MySQL "source" command.

So my question is: Is there a way to make the mysqldump routine behave correctly on Windows 10? Is there some option that can be set, or something like that?

It seems strange that the people who distribute MySQL would not have noticed this problem and found a way to fix it.

Options: ReplyQuote


Subject
Written By
Posted
Running mysqldump on windows 10
August 19, 2018 07:48PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.