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/mysqldump.html
About The Author
Vinu Thomas is a consultant on Webdesign and Internet Technologies. His website is http://www.mysql.com/doc/en/mysqldump.html. You can discuss about this article or any PHP/MYSQL related issues in our Discussion Forums: http://www.mysql.com/doc/en/mysqldump.html
Mokena prom limo .. Lockport Chicago limo O’HareIt's all about turn times in the eMedia industry! The... Read More
The first topic we are going to discuss... Read More
This article is for advanced Microsoft CRM SDK C# developers.... Read More
Make-or-Break Factors in Success and ProfitabilityFor quick printers, estimating can... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
If your company has regional and worldwide operations, you might... Read More
Fundraising software lets you connect with donors in a way... Read More
If you use Microsoft Outlook (or similar applications) for e-mailing,... Read More
When it comes to screenplay software each screenwriter needs to... Read More
Microsoft Business Solutions Great Plains has full-featured manufacturing set of... Read More
The Software 2005 conference is now a wrap. This conference,... Read More
Do you remember that frustrating feeling when you find an... Read More
We are in a transition phase in the Managerial Administration... Read More
Buying accounting software is a major investment. It's an important... Read More
I have recently created my first Php program. I wanted... Read More
All your software is stored on a hard-drive. But how... Read More
Your computer cost you from hundreds to thousands of dollars,... Read More
2005 ? Back to the Future.What does the future hold?... Read More
The stakes are high when considering security, privacy, and savings,... Read More
Most computer users use spreadsheets software such as Microsoft Excel... Read More
Program Flow is what you think it is. How the... Read More
Looking at all the ads which promise to get rid... Read More
Microsoft Retail Management (RMS) and Microsoft Great Plains are retail... Read More
If you company is small or mid-size special products or... Read More
For those who are unclear on the differences between the... Read More
Mokena Chicago limo O'Hare ..Microsoft Great Plains is now standard mid-market ERP application, serving... Read More
A LOT OF UNWANTED FILES.When you uninstall an item of... Read More
In the previous ISDN article, we looked at how and... Read More
After almost two decades of existence, Quark has become the... Read More
What is installation in the language of technology? Installation... Read More
Adware is a type of Spyware program that displays some... Read More
Before being able to choose a secure Internet communication system,... Read More
Let us give you - developer some hints in the... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
Microsoft Great Plains could be tuned and setup to fit... Read More
We don't think about mainframe software pricing anymore, we just... Read More
This article is the first of a series of articles... Read More
Traditionally we were considering functionally rich systems, such as SAP,... Read More
Are you lost in the mess of documents that get... Read More
When Great Plains Software introduced the first graphical accounting application... Read More
For those who still don't know, Microsoft Publisher helps computer... Read More
There are several kinds of software piracy. The bottom line... Read More
Innovative Maintenance Systems (IMS) is one company that offers solutions... Read More
Well, even if the combination might look very unusual, we... Read More
During the years of our consulting practice, which comes back... Read More
Microsoft PowerPoint has dramatically changed the way in which academic... Read More
There are so many different programs that clutter up your... Read More
Microsoft Great Plains is becoming more and more popular and... Read More
Small can be beautiful! Working with Knoppix for the past... Read More
Midsize business or non-profit organization should decide if one-vendor solution... Read More
Software |