question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Restore Database appears to be mangling dump file as Unicode

See original GitHub issue

Whenever I try to use the Restore database functionality to restore a dump file into my MariaDB database, I get the following error message:

ERROR 1062 (23000) at line 799: Duplicate entry '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xEF\xBF\xBD\xEF\xBF\xBD' for key 'PRIMARY'

After investigating the error, I found out that my dump file (dumped with DBeaver) did not have this sequence of bytes anywhere in the file. The error message was pointing to a section of the file with a bunch of raw binary data. I soon realized that EF BF BD is the Unicode replacement character byte sequence - �. I then tried to import the dump file using mysql at the command line, and had no issues, both db server and locally using the same mysql I pointed DBeaver at.

Thus, I conclude that somewhere along the line, DBeaver is parsing my dump file as Unicode and replacing any invalid byte sequences with the replacement character. This is not desirable - the file should be treated as binary and passed through to mysql untouched.

I am using the macOS version of DBeaver 4.3.3.1 and the 2.2.1 version of the MariaDB driver. My command line tools and server are all version 10.2.12-MariaDB. For what it’s worth, the dump I was using was dumped with the same version of DBeaver a few moments earlier, and I did not find that problematic byte sequence in the file, so as far as I can tell, dumping data works just fine.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
serge-ridercommented, Jan 29, 2018

Please one more time. One more small bug was fixed.

0reactions
jeliassoncommented, Jan 31, 2018

To people using HeidiSQL, update your version to the latest (9.5 at writing of this comment).

Read more comments on GitHub >

github_iconTop Results From Across the Web

restore - How to fix syntax errors in postgresql .sql dump file ...
The dump file should be in that encoding. I can see two possibilities: The file got mangled during transfer. To test for that, ......
Read more >
Restoring SQL_ASCII dumps to a UTF8-encoded database
for enc in ('cp1252', 'utf8'): print('Encoding', enc) try: file = open(fileName, ... Mangled text encoding dumps are a pain to work with.
Read more >
<class 'django.db.utils.DataError'> - Google Groups
Their solution might work for you - i.e. take a database dump, recreate the database with encoding set to UTF8, and then restore...
Read more >
Moving Moodle to Unicode - General developer forum
The problem is that it appears any conversion process is going to be ... that goes through the entire database and converts all...
Read more >
BackupPC Documentation - GitHub Pages
To view/restore backup #4, all the information is stored in backup #4. ... showing accurate directory listings of files, together with the MD5...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found