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
Oswego taxi to Midway ..Collaboration SoftwareCollaboration Software, also known as group collaboration software or... Read More
Microsoft Client Relation Management system (Microsoft CRM) and Microsoft RMS... Read More
In 2004 Oracle, Inc. made its new step toward J2EE... Read More
In the case when you represent mid-size or mid-size-to-large business,... Read More
Microsoft Business Solutions Great Plains has substantial market share and... Read More
Do you want to get quality software at a reasonable... Read More
Homeland security, airport security, Internet security ??" these days we???re... Read More
Microsoft Business Solutions Great Plains is mid and even corporate... Read More
Adware is a type of Spyware program that displays some... Read More
Microsoft Great Plains fits to majority of horizontals and retail... Read More
This article will not attempt to advocate the use of... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
In order to implement VLANs in a network environment, you'll... Read More
Microsoft CRM was designed to be easily customizable. Microsoft CRM... Read More
Navision Software was purchased by Microsoft and now it is... Read More
What is a Web Database?A web database is a database... Read More
Microsoft Business Solutions CRM is present several years on the... Read More
An operating system (abbreviated OS) is essentially the path through... Read More
Finding the best spyware removers to detect and remove spyware... Read More
Microsoft Great Plains, Navision, Solomon and Axapta are Microsoft Business... Read More
Rapid Application Development (RAD) is a software development methodology. In... Read More
Microsoft Great Plains fits to majority of industries, in the... Read More
If you are in the market for new staffing software,... Read More
If you have Microsoft Great Plains and support it... Read More
Passwords protect your most sensitive personal, financial and business information.... Read More
shuttle from Midway Morris ..Programming Help for BeginnersWe write programs to instruct computers. When... Read More
Most people don't use Photoshop to its fullest capabilities. Here... Read More
If there still are few unprotected computers left, I haven't... Read More
It's no secret that software companies operate in a very... Read More
Are you one of those people that keeps track of... Read More
Well, even if the combination might look very unusual, we... Read More
If you are in a business that passes documents around... Read More
And kill the best layout software in the process of... Read More
Microsoft Great Plains ? ERM from Microsoft Business Solutions and... Read More
According to a survey conducted by InfoTrends/CAP Ventures entitled "Content-Centric... Read More
When you think... Read More
Former Great Plains Software Dynamics/eEnterprise and currently Microsoft Business Solutions... Read More
Microsoft Business Solutions CRM data conversion deserves FAQ type of... Read More
In order to meet regulatory and corporate compliance requirements reporting... Read More
Professional services firm cuts costs and improves productivity with integrated... Read More
In the Clinton era the status quo was simple: you... Read More
MS CRM is very close to document workflow automation, including... Read More
Now there are Three Steps To Heaven Just listen and... Read More
Bar charts, bar graphs, and any other chart or graph... Read More
How would you like to prevent spyware and adware from... Read More
IBM Lotus Notes with Domino email server is traditional document... Read More
Just imagine: you are walking, say, towards your car, and... Read More
A wiki is an editable text-based website. But you don't... Read More
In the previous ISDN article, we looked at how and... Read More
Looks like Microsoft Great Plains becomes more and more popular,... Read More
Software |