123ArticleOnline Logo
Welcome to 123ArticleOnline.com!
ALL >> Computers >> View Article

Backing Up And Restoring Your Mysql Database

Profile Picture
By Author: Vinu Thomas
Total Articles: 2
Comment this article
Facebook ShareTwitter ShareGoogle+ ShareTwitter Share


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

Total Views: 132Word Count: 383See All articles From Author

Add Comment

Computers Articles

1. Managed Soc Services For It Companies
Author: Devendra singh

2. Ai Data Protection Compliance: Best Practices For Secure Business Operations
Author: Devendra singh

3. Privileged Access Management (pam): Strengthening Enterprise Security And Access Control
Author: Umangp

4. Qlikview Tutorial For Data Analytics: Create Interactive Dashboards And Reports
Author: Tech Point

5. Enterprise Email Security: Strengthening Protection Against Evolving Email Threats
Author: Umangp

6. Access Management Market Trends: Future Growth And Emerging Technologies
Author: Umangp

7. Mobile App Scraping
Author: MObile app scraping

8. Master Data Management Solutions: Driving Data Quality Through Ai And Cloud
Author: Umangp

9. Digital Marketing Analytics Platforms: Key Trends, Benefits, And Future Market Outlook
Author: Umangp

10. Ai Governance Market: Trends Driving Responsible Ai Adoption
Author: Umangp

11. Spark Matrix™: Access Management
Author: Umangp

12. The Future Of Digital Content In India: Why Photo Sharing And Cloud Storage Are Converging
Author: vijaylaxmi soni

13. Looking For German Industrial Chemicals Suppliers? Choose The Right Partner With Roteschemie
Author: Roteschemie

14. Ai Augmented Software Development: Ai-driven Coding, Automated Testing, Risk Prediction, Team Collaboration, Productivity, And Market Outlook
Author: Umangp

15. Kiosk Systems In Hyderabad For Modern Businesses
Author: pbs

Login To Account
Login Email:
Password:
Forgot Password?
New User?
Sign Up Newsletter
Email Address: