PDA

View Full Version : new to mysql



b
December 21st, 2000, 04:08
how can i make a backup of mysql data and how can i restore it? does each softwre you buy offer a script to back up the
data? i'm looking for basic info
thanks

jvv
December 21st, 2000, 06:29
Mysqldump does exactely what you are looking for.


mysqldump -u username -ppassword database_name > anything.sql

this will create a file called anything.sql, which you can download with any ftp client. In case you want to insert the info in the database again


mysql -u username -ppass database_name < anything.sql


Note that you have to have access to mysqldump, not all give this.

b
December 21st, 2000, 07:07
thankyou so much! this is exactly what i'm looking for.
why there is a space between -u and username
but there is no space between -p and password
or is it a typing mistake?

jvv
December 22nd, 2000, 11:05
No it has to be like that... something weird... if you don't put a space between -u username it doesn't get the username, and if you put one between the password, it doesn't see it a password...

atlas
December 22nd, 2000, 14:25
Just leave off the password.. meaning just give it the -p. It will then prompt you for your password and hide it as you type it.

mjk@atlascgi.com