Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using mysqldump

Status
Not open for further replies.

linuxtricks

IS-IT--Management
May 24, 2000
111
US
I apologize if this is the wrong forum to post about mysql.

I am hoping I will be able to find help on this somewhere:

I have been given the task of upgrading mysql from version 3.22 to version 3.23 on 3 servers. The very first task seems to be to 'backup' all of the existing databases.

I have been reading about how to do this, but am finding my search results to be quite confusing. (I am very very new to mysql and databases).

Generally speaking, does the following sound right to any of you mysql gurus out there(?):

[red]mysqldump -uUsername databasename |gzip > databasename.gz[/red]

Is that the right command to use when attempting to make a backup of all of the databases on your system?

Is there a safe way if doing this without putting your production databases at risk?

Thanks in advace for any help you can supply!
I HATE BEING A NEWBIE!
-grumpy smurf
 
Fortunately I've just gone through figuring out a backup strategy for our MySQL databases. I've found that has "pretty" good, albeit sometimes confusing, documentation - if you go to their

* click on "Documentation"
* Under Manual, click "searchable with
user comments"
* either scroll down or use the browser
search and look for "dump" - get down
to section "14.6 Dumping the Structure
and Data from MySQL Databases and
Tables" - click on this, and it tells you all
the options available for "mysqldump".
NOTE: I've noticed that this documentation is
slightly out-of-date. You can get help for
your specific version of MySQL by running
"mysqladmin --help" at the command prompt
(at least on Linux) - assuming your MySQL
us up and running.

I've been doing something like this:
mysqldump --opt --all-databases > dump.sql

View dump.sql when it's done - just so you see what
it creates - it's actually very nice.

and then if you want to re-create those databases in a new clean MySQL, use something like this:

mysql -u user -p < dump.sql

under the new MySQL version and you're all set.

This probably isn't the right forum for this - try to find
a mysql forum, or join one of the MySQL mailing lists(find these on under support)

HTH.
Hardy Merrill
Mission Critical Linux, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top