tags:

views:

322

answers:

5

Hi Guys,

         I am using MySQL 5.0 as back end with VB.NET as front end(Windows Applicaions). I want to take back up my database. I found one command through net as below.

mysql> mysqldump -u root -p root accounts > accounts.sql

My database name is "accounts". When i am trying to run the above command in mysql> prompt, it gives error. Where i have to run the above command? Kind help needed.Advance Thanks.

Sivakumar.P

+1  A: 

I've never used mysqldump inside mysql command line. Try using directly on shell/command-line. Hope it helps

Everton
Thanks pa, It works well..
sivakumar
+1  A: 

If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the --password or -p option on the command line, you are prompted for one.

What error are you getting? Here is the complete manual for mysqldump.

Shoban
+1  A: 

You must use mysql dump in the command line:

mysqldump --user=user --password=password database > database.sql

to restore:

mysql --user=user --password=password database < database.sql

jab
Thanks. It works fine.
sivakumar
A: 

Does this work in Windows though?? I have only used this in Linux, dunno about Windows...

Yes, it works on Windows too.
sjbotha
A: 

As others said, use mysqldump. Remember not dumping the whole database on a production server, as it will lock all rows during dump.

binar_E: mysqldump exists both for windows and *nix.

alexn