Taking a MySQL Dump
- Started
- Last post
- 4 Responses
- 187LockDown
I need major help. Im trying to do a mysqldump to back up a database, but I can't get it to work. Im on a windows server with MySQL 4.0.13-nt
I have tried every syntax I could find online and i still get Error 1064: You have an error in you SQL syntax. Check the manual...
Here is what my SQL looks like:
mysqldump -u [username] -p[password] [database] > [backup_file]
- chl0
You shouldn't have a space between the -u and the username. If my username was "chrislea" it would look like
mysqldump -uchrislea ....
At least on Linux. I've actually never done this in Windows.
- davetufts0
-u user should work with or without the space...typing your password on the command line is bad. just do this:
mysqldump -u user -p database > database.sql
you will be prompted for your password.
- davetufts0
...also, you should be typing this from the command line prompt, NOT from within the MySQL client (where you type queries)
- ldww0
and please remember to whipe afterwards