backing up mysql database

backing up mysql database

Posted by: akewl
Posted on: 2007-11-25 17:51:00

i am trying to backup mysql database using commandline linux. i am following this

mysqldump --opt -uusername -ppassword -h yourMySQLHostname dbname > output.sql

but i dont see any output.sql when i login to ftp. i have enabled ssh in dreamhost panel. plse help me.

Re: backing up mysql database

Posted by: wholly
Posted on: 2007-11-25 18:44:00

It's a lot easier to just do it through the panel using phpadmin at this link. https://panel.dreamhost.com/index.cgi?tree=goodies.mysql&

It'll even download it directly to your machine.

Note: If you are actually successfully using the command line you won't have to FTP in to see the file. It'll be right in the same directory from which you executed the command.

Note Also: DH mysql servers are not hosted at "localhost" like most documentation shows. There's not enough info in your post to make any determination as to whether you got that information correct or not.

Trust me - phpadmin is a pretty slick way to do what you're trying to do unless you want to do it as a cron job - and since you've discussed mixing ssh and ftp, I'm going to guess that you're not working with cron yet.



Wholly - Use promo code WhollyMindless for full 97$ credit. Let me know if you want something else!

Re: backing up mysql database

Posted by: sdayman
Posted on: 2007-11-26 06:04:00

Here's my format:
/usr/bin/mysqldump --all-databases -hDBMACHINE.MYDOMAIN.COM -uUSERNAME -pPASSWORD > ~/DB.sql

Keep the -u and -p and change the uppercase stuff.
The ~/ means to dump the db into my home directory, and not my domain directory or some other odd place.

-ScottEdited by sdayman on 11/26/07 06:05 AM (server time).

Re: backing up mysql database

Posted by: supernova
Posted on: 2007-11-27 02:07:00

In reply to:

Here's my format:
/usr/bin/mysqldump --all-databases -hDBMACHINE.MYDOMAIN.COM -uUSERNAME -pPASSWORD > ~/DB.sql


It works for me nicely. Have you do nslookup to your DBMACHINE.MYDOMAIN.COM ?

Or ... I don't know if it is the problem. See the allowable host value from your panel => https://panel.dreamhost.com/index.cgi?tree=goodies.mysql¤t_step=Index&next_step=ShowEditUser&usernamed=YOURUSERNAME. If you access from DH's server that value will be set to %.dreamhost.com but if you access it from local you should set to your IP address.

Hope it helps.

Supernova


Check out instructions on how to apply the code !

Tags: mysql databasebackup mysqlmysqldumpoptlinux