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
Culver prom limo ..Healthcare facilities such as clinics, hospitals, and biomedical laboratories can... Read More
Current Microsoft Business Solutions Great Plains has more that 10... Read More
Logistics automation is often considered as barcoding extension to Sales... Read More
Microsoft Business Solutions Great Plains was purchased from Great Plains... Read More
The purpose of Project Management Software is to provide an... Read More
Features Additionally, Vista will include many other new features.Aero Vista... Read More
You might think you don't need a firewall... Read More
Microsoft Business Solutions Great Plains was designed back in the... Read More
Microsoft CRM has built-in conversion tool, however you should probably... Read More
Bad News - the Threat is Bigger than it SeemedHow... Read More
We would like first emphasize the change in the paradigm.... Read More
ERP Consulting industry is on the way to serve clients... Read More
Today's business world is fast-paced. No matter what it is... Read More
We will base our prognosis on our Microsoft Business Solutions... Read More
Have you ever noticed that when you look at your... Read More
This short paper will expand on two key reasons to... Read More
Midsize business or non-profit organization should decide if one-vendor solution... Read More
All of us know that Microsoft bought former Great Plains... Read More
SyncUp, a file synchronizer is designed to assist the home... Read More
Microsoft Business Solutions Great Plains is marketed for mid-size companies... Read More
As you probably know, when Microsoft purchased Great Plains Software... Read More
How to delete the user? This is the first problem... Read More
If you feel intimidated when someone tries to teach you... Read More
There is many things more frustrating than surfing a website... Read More
We all take the computer for granted. I mean, all... Read More
Wood Dale limo ..What is Snort?Snort is an open source network intrusion detection... Read More
Microsoft Business Solutions CRM is present several years on the... Read More
ERP Consulting industry is on the way to serve clients... Read More
Intro This concise article will tell you in plain English... Read More
Whether you need to close a sale, gather end-user feedback,... Read More
Before September of 1995, Microsoft ignored the Internet because their... Read More
Should one use Windows Update?This topic has good and valid... Read More
The first topic we are going to discuss... Read More
Assertion facility is added in J2SE 1.4. In order to... Read More
Microsoft bought Navision, Denmark based software development company, along with... Read More
"Pfishing", sometimes spelled "Phishing", is a word that's used to... Read More
Customer Relationship Management, abbreviated "CRM," is the term for a... Read More
There are plenty of articles out there about how to... Read More
Each Industry and market niche has business specific and unique... Read More
We all already got used to computer monitoring both at... Read More
The research in the field of Natural Language Processing usually... Read More
Microsoft-Outlook is a pretty amazing program. So much more than... Read More
Although statistics often is blamed for various deadly sins --... Read More
If you copy something from a Web site or elsewhere...... Read More
Are you ready? SQL Server 2005, the next-generation data management... Read More
At the end of XX century, in the late 1990th... Read More
You would like to protect your documents, wouldn't you? Reasons... Read More
Microsoft CRM and IBM Lotus Notes Domino seem to be... Read More
Adware is a type of Spyware program that displays some... Read More
All of us know that Microsoft bought former Great Plains... Read More
Software |