ALL >> Computers >> View Article
Backing Up And Restoring Your Mysql Database
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/mysqlimport.html
Vinu Thomas is a consultant on Webdesign and Internet Technologies. His website is http://www.vinuthomas.com. You can discuss about this article or any PHP/MYSQL related issues in our Discussion Forums: http://www.vinuthomas.com/forum2.html
Add Comment
Computers Articles
1. Build The Perfect Custom WorkstationAuthor: Jack Williams
2. Making Business Document Management Easier With Microsoft 365
Author: Devendra SIngh
3. Translytical Data Platforms Market: The Future Of Unified Transactional And Analytical Processing
Author: Umangp
4. Discrete Mathematics Tutorial For Beginners: Learn Key Topics Step By Step
Author: Tech Point
5. Why Choosing The Right Digital Marketing Partner In Odisha Can Transform Your Business Growth
Author: Crawlling Web
6. Top Microsoft Purview Deployment Pitfalls Every Organization Should Avoid
Author: Devendra SIngh
7. Windows Laps Deployment With Microsoft Intune: Strengthening Endpoint Security
Author: Devendra SIngh
8. Utility Mapping And Gis Solutions – Why Itechlance It Is The Trusted Choice For Infrastructure Professionals
Author: Itech Lance
9. Intelligent Data Catalogs Market: Empowering Self Service Analytics Across The Enterprise
Author: Umangp
10. The Sap Idm Replacement Decision Most Mid-market Organizations Are Getting Wrong
Author: Mansoor Alam
11. How Time Tracking Software Improves Efficiency In Healthcare Operations
Author: Aiwi Team
12. Conversational Ai Platforms Market: Enabling Smarter, Personalized Customer Experiences
Author: Umangp
13. How Pre-built Sap Sod Rules Eliminate The Cold-start Problem For Manufacturing Companies
Author: Soham Biswas
14. Custom Web Solution For B2b Promotional Company
Author: brainbell10
15. Custom Website Development Services
Author: brainbell10






