I am writing this post because I cannot import a dump on MariaDB (Version 15.1) using Ubuntu 20.04.4 LTS. I did this dump a few weeks ago and now trying to import it using the command
mysql -u root -p database < dumpfile.sql
gives me the following error:
Error at line 46: 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.
So, I tried with the following command:
mysql -u root -p --binary-mode = 1 database < dumpfile.sql
But it gives me the following error:
Error at line 47: Unknown command '\▒'.
I tried to open the database using Notepad ++ and going to line 47 I noticed that it has strange characters:
I don't understand if it's a problem with the dump getting corrupted on export. I want to clarify that some parts are clearly visible, while others are seen with strange characters as in the figure.
I have tried various programs to check the integrity of the database (without success), I have tried to change the encoding of Notepad ++ to UTF-8 but nothing has changed.
I also tried to put
--default-character-set=utf8 in the command to import the database but it always gives me the above error.
I specify that the
.gz file appears to be corrupt (I cannot open it) and I do not have the possibility to do the dump again as I have the database only in
I tried with the command:
mysql --default-character-set=ucs2 -u root -p database < dumpfile.sql
But the result is: "Variable 'character_set_client' can't be set to the value of 'ucs2'".
As for the HEX, some points are legible, while others are "00 00 00 [...]".
In my database I find references to "GIT" and code in C #.