Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import mysql DB with XAMPP in command LINE

I have this command:

mysql -u #myusername -p #mypasswd MYBASE < c:\user\folderss\myscript.sql

But I get the following error:

Error
unknow command '\U'
unknow command '\m'
unknow command '\D'
unknow command '\L'
like image 771
Mamadou Avatar asked May 18 '11 08:05

Mamadou


4 Answers

For those using a Windows OS, I was able to import a large mysqldump file into my local XAMPP installation using this command in cmd.exe:

C:\xampp\mysql\bin>mysql -u {DB_USER} -p {DB_NAME} < path/to/file/ab.sql

Also, I just wrote a more detailed answer to another question on MySQL imports, if this is what you're after.

like image 84
joelhaus Avatar answered Oct 12 '22 05:10

joelhaus


Go to the xampp shell command line and run

mysql -h localhost -u username databasename < dump.sql
like image 34
bittu Avatar answered Oct 12 '22 07:10

bittu


You may also need to specify the host. From your statement, it looks like you run on Windows. Try this:

mysql -h localhost -u #myusername -p #mypasswd MYBASE
      < c:/user/folderss/myscript.sql

Or

mysql -h localhost -u #myusername -p #mypasswd MYBASE
       < "c:\user\folderss\myscript.sql"
like image 10
Andreas Krueger Avatar answered Oct 12 '22 06:10

Andreas Krueger


mysql -h localhost -u username databasename < dump.sql

It works, try it. If password is blank no need to add the -p args.

like image 5
niral Avatar answered Oct 12 '22 06:10

niral