Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql database backup with mysqldump

Tags:

mysql

I want to backup my database using mysql dump. This is the code I run in Command prompt when the location is mysql bin.
mysqldump -u root -pabc Db -r C:\Documents and Settings\All Users\Desktop\ttttt.sql
abc is the password. and I try to backup to a .sql file in desktop. I use mysql 5.5.
But the following error occured. mysqldump: Couldn't find table: "and"
But there is no table called 'and' in database and I didn't create such a table.But the error say about a 'and' table. How can I back up mysql database without this error.

like image 769
Débora Avatar asked Nov 20 '11 07:11

Débora


2 Answers

Try instead:

mysqldump -u root -pabc Db -r "C:\Documents and Settings\All Users\Desktop\ttttt.sql"

Your command shell is breaking apart the pathname into multiple arguments. The quotes tell the shell to pass it all as a single argument to the mysqldump program.

like image 134
sarnold Avatar answered Oct 18 '22 05:10

sarnold


I think there is some problem with syntax of command you are running. try something like this :

mysqldump -u root -p dbName > path\nameOfFile.sql

It will automatically ask for your password. You don't need to write it in command.

like image 38
gprathour Avatar answered Oct 18 '22 07:10

gprathour