0

I am updating software that used MySQL 5.4.3 in its old version, and now uses MariaDB 10.2.11. So, I dumped the old data with that command:

mysqldump -uroot -p --no-create-info --skip-triggers --complete-insert theDBName -r C:\Users\myUserName\theDBName_data.dump

Then I uninstalled MySQL and replaced it by MariaDB. After that I created the database and imported the new data structure (a few columns have been added with default values).

The issue occurs when restoring the old data:

mysql -uroot -p --default-character-set=utf8 theDBName
Enter password: ****************

MariaDB [theDBName]> SET names 'utf8';
MariaDB [theDBName]> SOURCE C:\Users\myUserName\theDBName_data.dump
ERROR: Unknown command '\U'.
ERROR: Unknown command '\a'
ERROR: Unknown command '\a'
ERROR: Failed to open file 'C:\Users\myUserName\theDBName_data.dump', error: 2

Restoring the exact same dump with that procedure works well on Linux, but doesn't on Windows.

Thanks for your help.

  • Version MySQL 5.4.3 never existed. Please check again. Perhaps you meant MariaDB 5.4.3? – Rick James Jul 31 at 23:57
  • mysql -V result : mysql.exe Ver 14.14 Distrib 5.4.3-beta, for Win32 (ia32) – T'lash Aug 1 at 11:26
  • The publisher has delivered to its customers its software with a beta version of mysql... – T'lash Aug 1 at 11:38
3

MariaDB [theDBName]> SOURCE C:\Users\myUserName\theDBName_data.dump

Either of the following should be correct:

MariaDB [theDBName]> SOURCE C:\\Users\\myUserName\\theDBName_data.dump

MariaDB [theDBName]> SOURCE C:/Users/myUserName/theDBName_data.dump
  • Oh, I really did not think about it, and yet it's a common problem... The first solution doesn't work (ERROR: Unknown command '\\'), but the second works as intended. Thank you. – T'lash Aug 1 at 11:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.