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
Alto Pass chicago limos ..Microsoft Great Plains is main Microsoft Business Solutions accounting package... Read More
When it comes to screenplay software each screenwriter needs to... Read More
Lotus Domino/Notes ? Microsoft Great Plains tandem as ERP with... Read More
When you buy a computer, it most likely comes with... Read More
Are you a whiz at calculating financial information? Not the... Read More
.Net Framework is a platform or development environment to seamlessly... Read More
A wiki is an editable text-based website. But you don't... Read More
In our case ? we serve Microsoft Business Solutions ERP... Read More
For a long time now Microsoft's Internet Explorer has ruled... Read More
Microsoft-Outlook is a pretty amazing program. So much more than... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Is your PC is slow and wimpy? Then you need... Read More
Introduction: The creating of a computer program involves a number... Read More
Having from five to ten and more favorite screensavers is... Read More
Great Plains Accounting, accounting package for mid-size and small companies... Read More
What is Interactive Mapping?Interactive mapping is a visual display medium... Read More
When Windows fails to boot it is normally caused by... Read More
What is Groupware?Have you ever had to manage document collaboration... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
So, why should you use any O/R mapping tool? I... Read More
Most computer users use spreadsheets software such as Microsoft Excel... Read More
If you have Microsoft Great Plains and support it for... Read More
What is Colossus?Colossus is software licensed to about twenty-five insurance... Read More
NOTE: Please take time to read on - it may... Read More
For a windows user like me, just can watch with... Read More
Alto Pass cool limo ..When it comes to running an office, the SOHO entrepreneur... Read More
It would be easy to think, like most people apparently... Read More
Are Spreadsheets Robbing your Enterprise of Competitive Advantage?'90% of "average"... Read More
The Microsoft system preparation utility for Windows 2000 is a... Read More
Before September 1995, Microsoft Windows was an MS-DOS program. DOS... Read More
If there still are few unprotected computers left, I haven't... Read More
TCO (Total Cost Ownership) is the buzzword in... Read More
Microsoft Great Plains is main Microsoft Business Solutions product, targeted... Read More
Before September of 1995, Microsoft ignored the Internet because their... Read More
The purpose of one of our projects was MS Exchange... Read More
Passwords protect your most sensitive personal, financial and business information.... Read More
Learning how to program software seems like a daunting task... Read More
Sales are all about leverage, because there is only so... Read More
eStore Advantage allows front-office applications to communicate with back-office business... Read More
1. What determines the software price? Is it Per Seat... Read More
ERP is the acronym of Enterprise Resource Planning. Multi-module ERP... Read More
Whether you have used Microsoft Word for years, have just... Read More
In linux, one of great commands for finding out information... Read More
Microsoft Business Solutions Great Plains is written in Great Plains... Read More
Does Microsoft Have any Real Competition? Copyright (c) 2003 Gregory... Read More
While several preventive maintenance software manufacturers offer free trials for... Read More
The java programming language is becoming more and more popular... Read More
When you first think about multicurrency ? you probably have... Read More
Microsoft Great Plains as ERP and Microsoft CRM as... Read More
In the new era of internet marketing the problem of... Read More
Software |