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
recurring maid service Wilmette ..Microsoft Business Solutions ? Navision is an integrated solution for... Read More
Just imagine: you are walking, say, towards your car, and... Read More
We are in a transition phase in the Managerial Administration... Read More
ERP Consulting industry is on the way to serve clients... Read More
What is Spyware?Spyware monitors your surfing habits and sends the... Read More
Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
Are you a database professional? Do you work with a... Read More
Assertion facility is added in J2SE 1.4. In order to... Read More
This article will not attempt to advocate the use of... Read More
Is Photoshop CS2 worth the upgrade? You bet it is!... Read More
In this small article we will be looking at the... Read More
Microsoft Business Solutions Great Plains and MS CRM (client relation... Read More
Crystal Reports is the most flexible tool on the market... Read More
1. What determines the software price? Is it Per Seat... Read More
Microsoft Great Plains and Microsoft CRM become more and more... Read More
For those who still don't know, Microsoft Publisher helps computer... Read More
And kill the best layout software in the process of... Read More
Pirated software is on the increase and now accounts for... Read More
We would like first emphasize the change in the paradigm.... Read More
How to delete the user? This is the first problem... Read More
Sticky Noteshttp://www.deprice.com/stickynote.htmWith StickyNote 9.0, you can create beautiful 3D notes... Read More
... Read More
Before September of 1995, Microsoft ignored the Internet because their... Read More
One day, you suddenly realize that your computer started to... Read More
Microsoft Business Solutions Great Plains has I'd say end user... Read More
last minute cleaning help Highland Park ..First we had the original Google search that evolved into... Read More
A few months back I really got sick of my... Read More
Usually, the easiest way to tell you have spyware is... Read More
The Internet is reshaping every form of communications medium, and... Read More
Microsoft Great Plains could be tuned and setup to fit... Read More
Microsoft Great Plains is now targeting large and midsize businesses... Read More
This short paper will expand on two key reasons to... Read More
Microsoft Business Solutions Great Plains, Navision, Axapta, Solomon and CRM... Read More
Microsoft Business Solutions Great Plains was purchased from Great Plains... Read More
So let's begin crunching down these 300 images using Adobe... Read More
2005 ? Back to the Future.What does the future hold?... Read More
Find out why Spyware Removal from computers is important and... Read More
Since technology changes so quickly, it is hard to begin... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Our opinion is based on our Microsoft Business Solutions Great... Read More
We will base our prognosis on our Microsoft Business Solutions... Read More
Document Manager and Version HistoryIn previous articles I have discussed... Read More
Not all of us have the luxury of working both... Read More
Once a business idea is selected, it is highly recommended... Read More
What is Tripwire?Tripwire is a form intrusion detection system (IDS)... Read More
Most people understand that the "hardware" part of their computer... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
I have recently created my first Php program. I wanted... Read More
If you have Microsoft Great Plains and support it... Read More
What is Colossus?Colossus is software licensed to about twenty-five insurance... Read More
Software |