Cannot start command line of sql file window using SOURCE command

Hi, I am using windows 7, xampp

. I am trying to run sql file using CMD ut, it gives me an error

 ERROR: Unknown command '\x'. 

this is what i do

enter image description here

this command does not work

 mysql> SOURCE C:\xampp\htdocs\elephanti2\db\mas_gis_city_ip.sql; 

*** Another problem with this works fine when I tried to go to phpmyadmin and import the file.

why this is happening, I have no idea, please help ..................

+6
source share
4 answers

My original answer:

 mysql> SOURCE C:\\xampp\\htdocs\\elephanti2\\db\\mas_gis_city_ip.sql; 

You can also try to run the command as follows:

 mysql> SOURCE C:/xampp/htdocs/elephanti2/db/mas_gis_city_ip.sql; 

(Source: Comment in the reference guide suggests using slashes on Windows machines)

+14
source

Try to specify a file name. Pay attention to your command:

mysql> SOURCE C: \ xampp \ htdocs ...

probably interpreted as:

mysql SOURCE C: \ xampp \ htdocs ...

(see \ x there?)

If you provide a file name, I'm sure it will work. (not sure if mysql requires "or" to quote file names in this context, try both)

+2
source

it actually worked. I think this is the previous dwuff answer.

 mysql> SOURCE C:\\xampp\\htdocs\\elephanti2\\db\\mas_gis_city_ip.sql; 

thanks

+1
source

I had the same problem I was trying to install FossTrak recently, and it was the syntax that worked on Windows 10, with Mysql 5.7

\. C:/share/epcis-repository-0.5.0/epcis_schema.sql

using \source not, and was not \\ , and I accidentally deleted it ; and it worked.

0
source

Source: https://habr.com/ru/post/913905/


All Articles