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
efficient cleaning crew Northbrook ..Almost all new and major brand of PCs come with... Read More
What is Groupware?Have you ever had to manage document collaboration... Read More
Microsoft Great Plains ? ERM from Microsoft Business Solutions and... Read More
Usually workflow & messaging is realized in CRM and then... Read More
Microsoft Great Plains is now targeting large and midsize businesses... Read More
Mike Dunville* had a decision to make. As the new... Read More
GroupwareEfforts are continually made to manage the unavoidable ad hoc... Read More
Microsoft Office program is a programming tool called Visual Basic... Read More
Using professional icons in your application or website can bring... Read More
While several preventive maintenance software manufacturers offer free trials for... Read More
Microsoft Great Plains fits to majority of horizontals and retail... Read More
While I was preparing some personal background information for a... Read More
I have recently created my first Php program. I wanted... Read More
Remember back in the days where screensavers were the coolest... Read More
Manufacturing in the USA is far away down from mid... Read More
Many Webmasters have never bothered to view their website's server... Read More
Microsoft Business Solutions Great Plains was purchased from Great Plains... Read More
Microsoft Great Plains is one of the Microsoft Business Solutions... Read More
Microsoft Business Solutions is emerging as very attractive vendor for... Read More
The objective for Zandi Digital is to make available clever... Read More
Passwords protect your most sensitive personal, financial and business information.... Read More
Introduction: The creating of a computer program involves a number... Read More
Microsoft Client Relation Management system (Microsoft CRM) and Microsoft RMS... Read More
Microsoft Business Solutions Great Plains has substantial market share and... Read More
Accounts payable is just one area of office management where... Read More
cleaning lady near Wilmette ..Current Microsoft Business Solutions Great Plains has more that 10... Read More
Microsoft Retail Management System serves retail single store as well... Read More
.Net Framework is a platform or development environment to seamlessly... Read More
Innovative Maintenance Systems (IMS) is one company that offers solutions... Read More
Now that spyware is the single most dangerous threat to... Read More
Microsoft Business Solutions CRM is present several years on the... Read More
Java has come along a long way. Many would agree... Read More
Fundraising software lets you connect with donors in a way... Read More
Task Manager is a Windows system utility that displays thetasks... Read More
New post-recession era has new features, which didn't exist in... Read More
Running Applications in Compatibility Mode With Windows XP, you can... Read More
Well, even if the combination might look very unusual, we... Read More
RSS (Really Simple Syndication) is a way for a site... Read More
When you buy a computer, it most likely comes with... Read More
Table of Contents1) Introduction 2) Related Work 3) Framework 4)... Read More
Microsoft Great Plains, former Great Plains Software Dynamics / eEnterprise... Read More
In our case ? we serve Microsoft Business Solutions ERP... Read More
What is RAID RECOVERY?RAID stands for Redundant Array of Inexpensive... Read More
Bill of Lading is required report for Logistics and Freight... Read More
Microsoft Great Plains ? ERM from Microsoft Business Solutions and... Read More
Microsoft Great Plains is one of the Microsoft Business Solutions... Read More
Blue Cross and Blue Shield of Hawaii (HMSA) found itself... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
Imagine something that follows you home and sets itself up... Read More
Introduction to C++Why Learn C++?C++ may at first seem like... Read More
Software |