HiveBrain v1.2.0
Get Started
← Back to all entries
debugsqlMinor

Error Unknown command '\U' when restoring MySQL dump on Windows

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
dumperrorunknownrestoringmysqlwindowswhencommand

Problem

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.

Solution

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

Code Snippets

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

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

Context

StackExchange Database Administrators Q#244270, answer score: 7

Revisions (0)

No revisions yet.