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
whole house cleaning Deerfield ..IBM Lotus Notes Domino and Microsoft CRM (Client Relation Management)... Read More
Using professional icons in your application or website can bring... Read More
Have you noticed WordPerfect is gearing up for a comeback... Read More
IntroductionPHP can be used for a lot of different things,... Read More
It won't matter how effective your WinRunner Team is if... Read More
Program Flow is what you think it is. How the... Read More
The vast majority of us will have, at some point,... Read More
An operating system (abbreviated OS) is essentially the path through... Read More
Microsoft Business Solutions Great Plains is written in Great Plains... Read More
Bill of Lading is required report for Logistics and Freight... Read More
If you feel intimidated when someone tries to teach you... Read More
IntroductionSurprised, by the title? well, this is a tour of... Read More
What is RAID RECOVERY?RAID stands for Redundant Array of Inexpensive... Read More
Security flaws have long plagued Internet Explorer (IE), the market-dominating... Read More
Microsoft Retail Management System serves retail single store as well... Read More
When Great Plains Software introduced the first graphical accounting application... Read More
SyncUp, a file synchronizer is designed to assist the home... Read More
Microsoft Business Solutions Great Plains might be considered as ERP... Read More
Midsize business or non-profit organization should decide if one-vendor solution... Read More
The intuitive algorithm.Roger Penrose considered it impossible. Thinking could never... Read More
Microsoft Outlook is one of the most widely used software... Read More
ERP is the acronym of Enterprise Resource Planning. Multi-module ERP... Read More
1. Replace Dexterity cursor with SQL Stored Procedure Dexterity... Read More
Lotus Domino/Notes ? Microsoft Great Plains tandem as ERP with... Read More
If you would like to pick something from Microsoft, or... Read More
home cleaning services Des Plaines ..We live in a post-industrial age where information is the... Read More
There are two major WYSIWYG(What You See Is What You... Read More
Every organization which creates collaborative documents, whether they are budgets,... Read More
Whether you are a small consultancy firm, a medium sized... Read More
In this short FAQ style article we would like to... Read More
Following tips help you to learn a software in lesser... Read More
It's not very often I get excited about a software... Read More
While I was in college, if you would have asked... Read More
Passwords protect your most sensitive personal, financial and business information.... Read More
ERP Consulting industry is on the way to serve clients... Read More
Crystal Reports is the most flexible tool on the market... Read More
As Mozilla Firefox nears 10% market share, with well over... Read More
With many manufacturing shops heading over seas in favor of... Read More
What is Software?Software is a set of instruction written to... Read More
Heard about the Quark "killer"?Adobe InDesign CS2. Will it really... Read More
NOTE: Please take time to read on - it may... Read More
C++ Function templates are those functions which can handle different... Read More
Microsoft Business Solutions Great Plains might be considered as ERP... Read More
IBM Lotus Domino or Microsoft Exchange?The severe competition continues for... Read More
Accounts payable is just one area of office management where... Read More
When Windows fails to boot it is normally caused by... Read More
Our hosted solution allow you to run your own search... Read More
MicroWorld Technologies, Inc. the leading solutions provider in the area... Read More
Bill of Lading is required report for Logistics and Freight... Read More
Buying accounting software is a major investment. It's an important... Read More
Software |