Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I use the mysqldump correctly [closed]

Tags:

database

mysql

I work with MySQL Server 5.5 and I have a problem in extracting my database,this is how I used this command:

mysql> mysqldump -uroot -pkail mybase > C:\Program Files\MySQL\MySQL Server 5.5\b 
in\base.sql; 

and this is the Error that I get:

ERROR: 
Unknown command '\P'. 
ERROR: 
Unknown command '\M'. 
ERROR: 
Unknown command '\M'. 
ERROR: 
Unknown command '\b'. 
Outfile disabled. 
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that 
corresponds to your MySQL server version for the right syntax to use near 'mysq 
dump -uroot -pkail mybase > C:\Program Files\MySQL\MySQL Server 5.5\bin' at 
line 1 

how can I resolve the problem and thanks for any help :)

like image 394
Lina Avatar asked Aug 24 '12 19:08

Lina


1 Answers

Mysqldump should not be executed from within MySQL. It is a separate command.

Exit the MySQL console and try it there.


If you look in C:\Program Files\MySQL\MySQL Server 5.5\bin, you'll see mysql.exe, and you'll also see mysqldump.exe. So mysqldump is a completely separate executable from mysql.exe, which is why you run it from the Windows command line, not from the MySQL console.

like image 173
Travesty3 Avatar answered Sep 26 '22 19:09

Travesty3