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
house refresh service Buffalo Grove ...Spyware and Adware infest over 90 percent of computers in... Read More
In the new era of internet marketing the problem of... Read More
Microsoft Great Plains ? ERM from Microsoft Business Solutions and... Read More
What is 'adware'?Adware is basically software or scripts that are... Read More
If you are to buy a HelpDesk & Asset Management... Read More
I like my software simple. If it's too complex or... Read More
Did you ever want to erase everything on your computer?... Read More
In the real world a "fire wall" is a fireproof... Read More
Sales are all about leverage, because there is only so... Read More
Microsoft Business Solutions main middle market ERP application - Microsoft... Read More
Microsoft Business Solutions Great Plains has I'd say end user... Read More
I have always regretted how Microsoft price gouges and rips... Read More
XML Server can be a Web Server that stores the... Read More
Bad News - the Threat is Bigger than it SeemedHow... Read More
Designing without tables by using CSS layouts is fast becoming... Read More
The fact that a software tester is a most infamous... Read More
Let's say that you have a software project that's under... Read More
Does Microsoft Have any Real Competition? Copyright (c) 2003 Gregory... Read More
What is RAID RECOVERY?RAID stands for Redundant Array of Inexpensive... Read More
Great Plains Fixed Assets Management module is a robust tool... Read More
IntroductionSurprised, by the title? well, this is a tour of... Read More
Great Plains Software Dynamics, Dynamics C/S+, eEnterprise were written on... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics... Read More
When you need a phone number, you do a quick... Read More
When my daughter was getting into AOL instant messaging (AIM)... Read More
move in cleaning service Park Ridge ...(1) Avoid using the same variable again and again for... Read More
At the end of XX century, in the late 1990th... Read More
Microsoft Business Solutions is now in process of creating so... Read More
The most important benefit of XML is its simplicity. Though... Read More
Microsoft Business Solutions ? Great Plains is designed to meet... Read More
If you have Microsoft Great Plains and support it for... Read More
You probably didn't casually invite, or extend a formal attendance... Read More
If you are in a business that passes documents around... Read More
Creating a new markup language.Introduction.General Reuse Markup Langauge, or GRML,... Read More
This article illustrates the best practices to improve the performance... Read More
CD and DVD replication is a process that works by... Read More
What is Colossus?Colossus is software licensed to about twenty-five insurance... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
This article is for advanced Microsoft CRM SDK C# developers.... Read More
There are two approaches for application integration:? Programmer's approach ?... Read More
Stealing company information used to be the specialty of spies... Read More
Are you ready? SQL Server 2005, the next-generation data management... Read More
Following tips help you to learn a software in lesser... Read More
Innovative Maintenance Systems (IMS) is one company that offers solutions... Read More
No matter how much you enjoy your favorite screensavers, sometimes... Read More
In this article you will find some background information about... Read More
Security flaws have long plagued Internet Explorer (IE), the market-dominating... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Whether you have used Microsoft Word for years, have just... Read More
Microsoft Retail Management (RMS) and Microsoft Great Plains are retail... Read More
Software |