Back-up Database Query Questions


I stink at SQL, this is a dumb question but help is greatly appreciated…

what would I type in for the query below?
for example purposes, username = JJ, password = JJ99, hostname = yippie, dbname = message

what would #2 look like as entered into the SQL query, I’m assuming I need to remove some of this but I’m not sure what?
mysqldump --opt -JJ -JJ9 -h yippie message > filename.sql

Also, where do I find the symbol between cat filename.sql and mysql below…
cat filename.sql | mysql

  1. From the shell, run this command:
    mysqldump --opt -uusername -ppassword -h yourMySQLHostname dbname > filename.sql

To restore your database from a backup:

Take that db dump and do:
cat filename.sql | mysql -uusername -ppassword -h yourMySQLHostname dbname


I think your hostname is going to be along the lines of, so I’d try something like this for starters

mysqldump --opt -uJJ -pJJ99 -h message > backupname.sqlThe pipe symbol | is Shift-\ on my keyboard.


thanks haggis, I will try that out…