?> Backing Up And Restoring Your MySQL Database

CashCome.com Articles Pages

Home
Articles Index
Site Map

Backing Up And Restoring Your MySQL Database

?>

Download eBooks and Software

Fully Verified Winning System Since 1999 & Vip Club Picks!
Winning Sports Picks & Predictions By Zcodesystem.com - Nhl, Nfl, Mlb And Nba Predictions And Picks From The Best Experts In The Industry + Fully Automated System Proven Since 1999 Awesome Conversion 5.26% And Recurring 60% Commission!

The Lotto Black Book
This Radical Approach To An Online Sales Letter Converts In The 3-5%... We've Never Seen Something Like This Since The Early Days Of 2004-2005 And I'm Sure You Haven't Either... We Convert More Than Our Competition And We Pay Out More... Try It!

Paleo Recipe Book - Brand New Paleo Cookbook
Brand New Paleo Diet Cookbook With Over 370 Recipes. Pays 70% Commission On This High-quality, Easy To Sell Product. Get Banners And Promotional Material At Http://paleorecipebook.com/affiliates.html


Articles > Computers and The Internet

Backing Up And Restoring Your MySQL Database

 by: Vinu Thomas

If you've been using MySQL database to store your important data, it is imperative that you make a backup of your data to prevent any loss of data. This article shows you how to backup and restore data in your MySQL database. This process can also be used if you have to move your data to a new server.

Backing up your database

The quickest and easiest way to backup and restore your database would be to use MySQLDump. If you've got shell or telnet access to your server, you can backup MySQL data by issuing the mysqldump command. The syntax for the command is as follows.

mysqldump -u [uname] -p [pass] [dbname] > [backupfile.sql] [uname] - this is your database username [pass]- this is the password for your database [dbname] - the name of your database [backupfile.sql] - the filename for your database backup

To backup your database 'Customers' with the username 'sadmin' and password 'pass21' to a file custback.sql, you would issue the command

mysqldump -u sadmin -p pass21 Customers > custback.sql

Issuing this command will backup the database to custback.sql. This file can be copied to a safe location or a backup media and stored. For more information on MySQLDump, you can check out : http://www.mysql.com/doc/en/mysqldump.html

Restoring your database

If you have to re-build your database from scratch, you can easily restore the mysqldump file by issuing the following command. This method will not work if the tables already exist in your database.

mysql - u sadmin -p pass21 Customers < custback.sql

If you need to restore existing databases, you'll need to use MySQLImport. The syntax for mysqlimport is

mysqlimport [options] database textfile1

To restore your previously created custback.sql dump back to your Customers Database, you'd issue

mysqlimport -u sadmin -p pass21 Customers custback.sql

For more information on MySQLImport, you can check out : http://www.mysql.com/doc/en/mysqlimport.html

About The Author

Vinu Thomas is a consultant on Webdesign and Internet Technologies. His website is http://www.vinuthomas.com. You can discuss about this article or any PHP/MYSQL related issues in our Discussion Forums: http://www.vinuthomas.com/forum2.html

?>


News on Computers and The Internet

Google: Up to 500,000 Computers Face Disconnection From The Internet
On Tuesday internet services giant Google began warning users infected with the DNSChanger malware that they face disconnection from the web if they don't disinfect their computer.

Eastday-Software piracy declined in 2011
Less than 40 percent of software installed on computers in China was pirated in 2011, a decline of 3 percentage points from the previous year, according to Chinalabs.com, a consulting and research company.

HP stock jumps after job cuts announced
COMPUTERS HP stock jumps after job cuts announced Hewlett-Packard rose the most in more than a month a day after the world's largest personal-computer maker announced plans to slice its workforceby 27,000 and reported...

Yahoo seeks to shake up search, Web browsing
Joining the battle to redefine Internet search, Yahoo is taking aim with a new browser enhancement it calls "Axis."

Lebanon School District unveils Megan's Law, web policies
The Lebanon school board is introducing a pair of policies - one governing student-staff communications that would give the district the right to access employees personal computers and another involving sexually violent predators registered under Megan s Law.

transparent