Gossamer Forum
Home : General : Databases and SQL :

New to MySQL

Quote Reply
New to MySQL
A couple of questions...

I have a MySQL database setup with multiple tables and would like to know how to make a backup of the database?

Also, once the database is backed up - if I should ever choose to change hosting companies can I restore or move the database to the new host relatively easy? What are the steps involved?

Thanks for any help!

D
Quote Reply
Re: [donm] New to MySQL In reply to
To backup from telnet:

mysqldump -uUSERNAME -p DATABASE_NAME > /path/to/backup.txt
Enter Password: PASSWORD

Change USERNAME DATABASE_NAME and PASSWORD to the corresponding values for your database.

You may want to install mysqlman which will automate backups/restoring from your browser.

Last edited by:

Paul: Jun 6, 2002, 7:33 AM
Quote Reply
Re: [donm] New to MySQL In reply to
The only problem you may confront is subtle differences between different versions of MySQL that may pose problems in restoring your database to the new hosting company's server.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Paul] New to MySQL In reply to
Quote:
mysqldump -uUSERNAME -p DATABASE_NAME > /path/to/backup.txt
Enter Password: PASSWORD

Paul..your always telling me to make things easier Tongue

Why not use;

mysqldump -uUSERNAME -pPASSWORD DATABASE_NAME > /path/to/backup.txt

Wink

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] New to MySQL In reply to
That way is fine as long as you are aware of the security implications:

1. Your mysql user/pass will be visilbe in `ps` output for anybody else on the system to see during the dump.
2. Your mysql user/pass will be stored in your history, which could be viewed by anyone who logs in as you.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] New to MySQL In reply to
Your first point is unbelivably important here. That's one I only recently learned.

I was writing a client to access to poll a website which requires a login userid/password. It worked from the command line, and of course I follishly supplied username/password arguments to it on the command line too - until I discovered that around 1,000 users could easily just watch my username/password combination all day long.

Ack. This one really does byte a lot of people and something that should be stressed more often in security FAQs.

- wil