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
![]() |
|
![]() |
|
![]() |
|
![]() |
While paper labeling CDs and DVDs may appear to be... Read More
As you probably know, when Microsoft purchased Great Plains Software... Read More
This article is for advanced Microsoft CRM SDK C# developers.... Read More
Three highly respected names in Human Resources have joined forces... Read More
Microsoft Great Plains fits to majority of horizontals and retail... Read More
Microsoft Business Solutions Great Plains was historically designed to serve... Read More
We all take the computer for granted. I mean, all... Read More
This is the tutorial where we really get into programming.... Read More
Former Great Plains Software Dynamics/eEnterprise and currently Microsoft Business Solutions... Read More
Preventive Maintenance (PM) is defined as scheduled work done on... Read More
Here is some free software tools to help you build... Read More
Microsoft Business Solutions Navision serves both European and American megamarkets.... Read More
Accounts payable is just one area of office management where... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
As seeing large number of implementations ? in our case... Read More
This article is the third of a series of articles... Read More
The Windows registry is a huge database that ensures normal... Read More
Trying to figure out a stream in banning one email... Read More
Costs of fleet maintenance software can vary widely. It is... Read More
With the advent of 'Service Pack 2' for Windows XP... Read More
Blue Cross and Blue Shield of Hawaii (HMSA) found itself... Read More
I suggest that you do not spend a lot of... Read More
One of the main reasons business owners and entrepreneurs use... Read More
In this article you will find some background information about... Read More
One day, you suddenly realize that your computer started to... Read More
Heard about the Quark "killer"?Adobe InDesign CS2. Will it really... Read More
The research in the field of Natural Language Processing usually... Read More
No matter how much you enjoy your favorite screensavers, sometimes... Read More
While Adobe is the most known maker of PDF tools,... Read More
.NET platform does not support multiple inheritance. Do not confuse... Read More
Microsoft Business Solutions CRM proved to be reliable solution in... Read More
If you have Microsoft Great Plains as main accounting and... Read More
Microsoft Outlook is one of the most widely used software... Read More
Sticky Noteshttp://www.deprice.com/stickynote.htmWith StickyNote 9.0, you can create beautiful 3D notes... Read More
Stop the Runaway MouseWhat's the "runaway mouse?" You've seen it...you... Read More
This is the tutorial where we really get into programming.... Read More
Ok... Where to start?Well, I guess I will start at... Read More
Should one use Windows Update?This topic has good and valid... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
How to delete the user? This is the first problem... Read More
Table of Contents1) Introduction 2) Related Work 3) Framework 4)... Read More
Microsoft Business Solutions Great Plains is very generic accounting application... Read More
Is Photoshop CS2 worth the upgrade? You bet it is!... Read More
Several software companies design programs for preventive maintenance. Most of... Read More
If you're online using a dialup Internet connection, you'll probably... Read More
Since technology changes so quickly, it is hard to begin... Read More
Microsoft Business Solutions Great Plains serves multiple industries in the... Read More
We'll give you non formal view, based on our consulting... Read More
As of now - Great Plains Dynamics/eEnterprise is transformed/renamed into... Read More
Just imagine: you are walking, say, towards your car, and... Read More
While paper labeling CDs and DVDs may appear to be... Read More
Although we don't know whether Microsoft ever envisioned such a... Read More
As Mozilla Firefox nears 10% market share, with well over... Read More
Microsoft CRM is winning market share step-by-step from such the... Read More
Former Great Plains Software Dynamics/eEnterprise, and currently Microsoft Business Solutions... Read More
This article is the third of a series of articles... Read More
If you have Microsoft Great Plains and support it for... Read More
We were recently faced with a decision: either to let... Read More
Once upon a time not so long ago, there was... Read More
Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics/eEnterprise... Read More
1. With mapping software you can create a report that... Read More
What is Interactive Mapping?Interactive mapping is a visual display medium... Read More
Does Microsoft Have any Real Competition? Copyright (c) 2003 Gregory... Read More
Microsoft SQL Server is the leader for inexpensive and middle... Read More
If your company has regional and worldwide operations, you might... Read More
Microsoft Business Solutions Great Plains has substantial market share and... Read More
Software |