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
cleaning lady near Glencoe ...In linux, one of great commands for finding out information... Read More
Microsoft Great Plains - Microsoft Business Solutions accounting and ERP... Read More
Your computer cost you from hundreds to thousands of dollars,... Read More
We all take the computer for granted. I mean, all... Read More
Microsoft Great Plains has substantial mid-market share in the USA... Read More
Our hosted solution allow you to run your own search... Read More
We've all seen the ads on TV for Netzero 3G.... Read More
If you company is small or mid-size special products or... Read More
XML parser is a software module to read documents and... Read More
Research bears that less than 70 percent of development projects... Read More
Microsoft CRM and IBM Lotus Notes Domino seem to be... Read More
Before September of 1995, Microsoft ignored the Internet because their... Read More
Microsoft CRM is CRM application, maintained and supported by Microsoft... Read More
Microsoft Business Solutions Great Plains is written in Great Plains... Read More
For a windows user like me, just can watch with... Read More
Microsoft Business Solutions Great Plains fits to majority of horizontal... Read More
What is RAID RECOVERY?RAID stands for Redundant Array of Inexpensive... Read More
Stop the Runaway MouseWhat's the "runaway mouse?" You've seen it...you... Read More
Language development computer: Computer-based method for aiding language development seems... Read More
Microsoft Great Plains fits to majority of horizontals and retail... Read More
Microsoft Business Solutions CRM is present several years on the... Read More
C++ Function templates are those functions which can handle different... Read More
We would like to give you several situations, when you... Read More
It's all about turn times in the eMedia industry! The... Read More
Microsoft Business Solutions Navision is main ERP application for European,... Read More
affordable house cleaning Wilmette ...Which Type of Shop Can Rely On A Home Built... Read More
C/SIDE (Client/Server Integrated Development Environment) - The core of... Read More
DBxtra is a powerful query and reporting tool that hides... Read More
Microsoft Great Plains may be recommended for international freight forwarding... Read More
The first topic we are going to discuss... Read More
If someone entered your home, uninvited and installed numerous cameras... Read More
Adobe Photoshop is one of the world's leading graphics editing... Read More
When you buy a computer, it most likely comes with... Read More
Crystal Reports is the most flexible tool on the market... Read More
The world of small business accounting software can be a... Read More
As you probably know, when Microsoft purchased Great Plains Software... Read More
Security flaws have long plagued Internet Explorer (IE), the market-dominating... Read More
I have recently created my first Php program. I wanted... Read More
Blue Cross and Blue Shield of Hawaii (HMSA) found itself... Read More
According to a survey conducted by InfoTrends/CAP Ventures entitled "Content-Centric... Read More
The most important things you can do for your computer... Read More
Simply put, fleet maintenance allows companies to monitor and maintain... Read More
COMMAND LINE FUNCTIONA powerful command line script processor has been... Read More
In our small article we'll consider Microsoft Business Solutions Great... Read More
In the new era of internet marketing the problem of... Read More
Have you noticed WordPerfect is gearing up for a comeback... Read More
Some introduction into Great Plains Software products, now Microsoft Business... Read More
Collaboration SoftwareCollaboration Software, also known as group collaboration software or... Read More
Software Engineering is the Systematic Approach for analysis design implementation... Read More
Microsoft SQL Server is the leader for inexpensive and middle... Read More
Software |