2

here is my command to import a sql file into mysql using command line

mysql -p eshop < c:\xampp\mysql\eshop.sql

But there is error message

Error:
Unknown command '\x'

Error:
Unknown command '\m'

Error:
Unknown command '\e'

Anyone knows what's wrong with the command?

0

2 Answers 2

1

Try this, I think this may help you.

mysql -u username -p database_name < file.sql

check mysql Options. Don't use \ (slash) use / (slash) to mention the file path.

Sign up to request clarification or add additional context in comments.

Comments

0

On Windows, the pathname separator character is ‘\’, but MySQL treats the backslash as the escape character in strings. To deal with this issue, write separators in Windows pathnames either as ‘/’ or as ‘\\’. To load a file named C:\mydata\data.txt, specify the filename as shown in either of the following statements:

mysql  <database_name> < ‘C:/mydata/data.txt’
mysql  <database_name> < ‘C:\\mydata\\data.txt’

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.