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
Music downloads are off the charts! We're listening to digital... Read More
What is installation in the language of technology? Installation... Read More
When you double-click a layer in the Layer Palette, you... Read More
We would like to give you pluses and minuses of... Read More
Sometimes your PC will start acting strange for no apparent... Read More
Finally, you have some time to personalize your desktop with... Read More
Great Plains Inventory Management (IV) module gives your business a... Read More
This article illustrates the best practices to improve the performance... Read More
Software Engineering is the Systematic Approach for analysis design implementation... Read More
In the case when you represent mid-size or mid-size-to-large business,... Read More
C/SIDE (Client/Server Integrated Development Environment) - The core of... Read More
You've finally created databases that you can actually use to... Read More
When reading an article where some term is used often,... Read More
So let's begin crunching down these 300 images using Adobe... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
Most people don't use Photoshop to its fullest capabilities. Here... Read More
Microsoft Business Solutions Small Business Manager is scaled down Great... Read More
DBxtra goes ASPGetting to the information hidden within corporate databases... Read More
Using professional icons in your application or website can bring... Read More
Microsoft Great Plains is main accounting / ERP application... Read More
Great Plains Software Dynamics, Dynamics C/S+, eEnterprise were written on... Read More
Current Microsoft Business Solutions Great Plains has more that 10... Read More
C++ Function templates are those functions which can handle different... Read More
Microsoft Business Solutions Great Plains was designed back in the... Read More
This is a short article, written in question/answer/FAQ style to... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
I like my software simple. If it's too complex or... Read More
Shareware has been fighting the stigma of being misunderstood for... Read More
Let's say that you have a software project that's under... Read More
Microsoft Great Plains fits to majority of horizontals and retail... Read More
What is Tripwire?Tripwire is a form intrusion detection system (IDS)... Read More
Microsoft Great Plains, former Great Plains Software Dynamics / eEnterprise... Read More
Healthcare facilities such as clinics, hospitals, and biomedical laboratories can... Read More
1. With mapping software you can create a report that... Read More
Manufacturing in the USA is far away down from mid... Read More
Several software companies design programs for preventive maintenance. Most of... Read More
Here is some free software tools to help you build... Read More
Before September of 1995, Microsoft ignored the Internet because their... Read More
IBM Lotus Notes Domino and Microsoft CRM (Client Relation Management)... Read More
The fact that a software tester is a most infamous... Read More
Crystal Reports is the most flexible tool on the market... Read More
In order to implement VLANs in a network environment, you'll... Read More
Table of Contents1) Introduction 2) Related Work 3) Framework 4)... Read More
This article illustrates the best practices to improve the performance... Read More
Small can be beautiful! Working with Knoppix for the past... Read More
Our company, Novaprof Inc., developed unique software - DB Integration.... Read More
What is 'adware'?Adware is basically software or scripts that are... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
In 2004 Oracle, Inc. made its new step toward J2EE... Read More
Most people understand that the "hardware" part of their computer... Read More
I have recently created my first Php program. I wanted... Read More
Did you ever want to erase everything on your computer?... Read More
Microsoft CRM and IBM Lotus Notes Domino seem to be... Read More
Handling character strings in Java is supported through two final... Read More
Remember nice and prosperous Clinton era? When you implemented innovative... Read More
I started using PIP (Picture It Publishing) Platinum 2002 right... Read More
Does Microsoft Have any Real Competition? Copyright (c) 2003 Gregory... Read More
First we had the original Google search that evolved into... Read More
Microsoft Business Solutions Great Plains has substantial market share and... Read More
Whether you are a small consultancy firm, a medium sized... Read More
When Great Plains Software introduced the first graphical accounting application... Read More
Microsoft Business Solutions CRM and IBM Lotus Notes Domino, being... Read More
Most computer users use spreadsheets software such as Microsoft Excel... Read More
In our opinion, traditional approach when you select ERP/MRP system... Read More
Microsoft SQL Server is the leader for inexpensive and middle... Read More
Microsoft Retail Management System serves retail single store as well... Read More
Software |