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
limousine Ackley .. Lockport Chicago limo O’HareThis article is the third of a series of articles... Read More
I suggest that you do not spend a lot of... Read More
Remember old good days when your company probably had Great... Read More
Have you ever noticed that when you look at your... Read More
Microsoft Office program is a programming tool called Visual Basic... Read More
IBM Lotus Notes with Domino email server is traditional document... Read More
Microsoft Business Solutions Great Plains has full-featured manufacturing set of... Read More
When making a decision to buy any piece of software... Read More
A UNIX Shell is in simplest terms, a command line... Read More
Finding the best spyware removers to detect and remove spyware... Read More
GroupwareThe internet is full of 1.5 million to 7 million... Read More
Research bears that less than 70 percent of development projects... Read More
Small can be beautiful! Working with Knoppix for the past... Read More
Adobe Photoshop is one of the world's leading graphics editing... Read More
In this small article we will be looking at the... Read More
Microsoft Business Solutions Great Plains is very popular ERP/MRP applications... Read More
Creating a new markup language.Introduction.General Reuse Markup Langauge, or GRML,... Read More
I like my software simple. If it's too complex or... Read More
ERP Consulting industry is on the way to serve clients... Read More
Most people understand that the "hardware" part of their computer... Read More
All of us know that Microsoft bought former Great Plains... Read More
Spyware, what it is and what it does. Basically, spyware... Read More
For a windows user like me, just can watch with... Read More
I have recently created my first Php program. I wanted... Read More
Since its release in 1987, QuarkXpress had made an immediate... Read More
shuttle from O'Hare Alexander ..It is now common thing when large corporation selects mid-market... Read More
We live in a post-industrial age where information is the... Read More
In the case when you represent mid-size or mid-size-to-large business,... Read More
Looks like Microsoft Great Plains becomes more and more... Read More
With thousands of web pages added to the Net every... Read More
The Windows Indexing Service provides you with the ability to... Read More
Microsoft Business Solutions Great Plains version 8.5, 8.0, 7.5, Great... Read More
Some introduction into Great Plains Software products, now Microsoft Business... Read More
Microsoft Business Solutions products: Great Plains, MS CRM, Navision, Axapta,... Read More
Disclaimer: All the thoughts expressed are my views only! Your... Read More
Just imagine: you are walking, say, towards your car, and... Read More
Microsoft CRM is new player on the CRM software... Read More
This is a short article, written in question/answer/FAQ style to... Read More
Introduction: The creating of a computer program involves a number... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
SOFTWARE PIRACY We regularly hear reports... Read More
If you are software developer or database administrator - we... Read More
Let's say that you have a software project that's under... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
Follow the steps below to quickly design, generate, and deploy... Read More
In our opinion, traditional approach when you select ERP/MRP system... Read More
OEComplete is a utility for managing the personal information of... Read More
Do you remember that frustrating feeling when you find an... Read More
We would like first emphasize the change in the paradigm.... Read More
Assertion facility is added in J2SE 1.4. In order to... Read More
Software |