Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Backing Up and Restoring A MySQL Database

Backing Up and Restoring A MySQL Database Backing Up and Restoring A MySQL Database This tutorial explains the how to backup and restore the MySQL Database. Databases are used to store large amount of precious data and it becomes very important to

Tutorial Details:

Backup your data. In case case of some hardware or software failures backup data can be used to restore the Database.
Backing Up MySQL Database
MySQL database backup can be accomplished in two ways:
a) Copying the raw mysql database files &
b) Exporting tables to text files
Copying the MySQL database files
MySQL uses the same table format on different platforms, so it's possible to copy MySQL table and index files from one platform and use them on another without any difficulties (assuming, of course, that you're using the same version of MySQL on both platforms).
Exporting tables to text files
The MySQLDump is handy utility that can be used to quickly backup the MySQL Database to the text files. To use the MySQLDump utility it is required to logon to the System running the MySQL Databse. You can use Telnet to remotely logon to the system if you don't have the physical access to the machine.
The syntax for the command is as follows.
mysqldump -u [Username] -p [password] [databasename] > [ backupfile.sql]
[username] - this is your database username
[password]- this is the password for your database
[databasename] - the name of your database
[backupfile.sql] - the filename for your database backup
Let's discuss the example of backing up MySQL Database named "accounts" into text file accounts.sql. Here are the scenarios of taking the backup assuming that both user name and password of the database is "admin".
a) Taking the full backup of all the tables including the data.
Use the following command to accomplish this:
mysqldump -u admin -p admin accounts > accounts.sql
b) Taking the backup of table structures only.
Use the following command to accomplish this:
mysqldump -u admin -p admin --no-data accounts > accounts.sql
c) Taking the backup data only.
Use the following command to accomplish this:
mysqldump -u admin -p admin --no-create-info accounts > accounts.sql
Restoring MySQL Database
Restoring the MySQL is very easy job. You can use the following to command to restore the accounts database from accounts.sql backup file.
mysql - u admin -p admin accounts < accounts.sql
In this tutorial you learned how to take the backup of your MySQL Database and restore the same in the event of some database crash or on some other machine.


 

Rate Tutorial:
http://www.roseindia.net/mysql/mysql_backup_restore.shtml

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Backing Up and Restoring A MySQL Database

View Tutorial:
Backing Up and Restoring A MySQL Database

Related Tutorials:

Reading textual data: Fun with streams - JavaWorld - April 1999
Reading textual data: Fun with streams - JavaWorld - April 1999
 
Develop Java portlets
Develop Java portlets
 
Using CachedRowSet to Transfer JDBC Query Results Between Classes
Using CachedRowSet to Transfer JDBC Query Results Between Classes The Java Database Connectivity (JDBC) API provides developers with an interface to a SQL database server, such as MySQL or Oracle. Central to any JDBC application is the java.sql.ResultS
 
JForumFusion
About jForumFusion JForumFusion is a platform independent discussion board program.
 
Jeff Schmitt's JDBC Page
This tutorial assumes you are using the MySQL database and the GWE JDBC drivers. The host computer is triton.towson.edu.
 
Backing Up and Restoring A MySQL Database
Backing Up and Restoring A MySQL Database Backing Up and Restoring A MySQL Database This tutorial explains the how to backup and restore the MySQL Database. Databases are used to store large amount of precious data and it becomes very important to
 
Welcome to Java Developers paradise!
Welcome to Java Developers paradise! T his site contains many quality Java, JSP, RMI, MySQL downloads, tutorials, source codes and links to other java resources. We have large number of links to the tutorials on java which will help you learn java
 

Linux Hosting Plans Proxima Web-Hosting Our basic hosting packages include support for a wide variety of web technologies, backed by instant account management with our Personal Control panel. With our guaranteed
 
First Step towards JDBC!
First Step towards JDBC! First Step towards JDBC Introduction T his article introduce you with JDBC and shows you how to create a database application to access the databases. For the shake of simplicity, in very first example Access database and
 
First Step towards JDBC!
First Step towards JDBC! Welcome to our JDBC Section First Step towards JDBC This article introduce you with JDBC and shows you how to create a database application to access the databases. Accessing the Database from Servlet This article shows
 
Accessing Database from servlets through JDBC!
Accessing Database from servlets through JDBC! Accessing Access Database From Servlet T his article shows you how to access database from servlets. Here I am assuming that you are using win95/98/2000 and running Java Web Server. For the sake of
 
Welcome to the MySQL Tutorials
Welcome to the MySQL Tutorials Welcome to the MySQL Tutorials Using MYSQL Database This lesson is intended to provide hands an experience with MYSQL database Backing Up and Restoring A MySQL Database In this lession you will learn how to take
 
Using MYSQL Database with JSP & Servlets.
Using MYSQL Database with JSP & Servlets. Using MYSQL Database with JSP & Servlets. MY SQL is a powerful RDBMS, which can handle large amount of data. And more interestingly it is free to use, except for some commercial use. you can download it
 
Connecting to MySQL database and retrieving and displaying data in JSP page
Connecting to MySQL database and retrieving and displaying data in JSP page Connecting to MySQL database and retrieving and displaying data in JSP page This tutorial shows you how to connect to MySQL database and retrieve the data from the
 
Introduction to the JDBC
Introduction to the JDBC Introduction to the JDBC Introduction T his article introduce you with JDBC and shows you how to our search engine with database. What is JDBC? J ava Database Connectivity or JDBC for short is set of Java API's that
 
Connecting to the Database Using JDBC and Pure Java driver
Connecting to the Database Using JDBC and Pure Java driver Connecting to the Database JDBC Driver In our search engine we are using MySQL database server and MM.MySQL Driver for connecting our application to the database. MM.MySQL Driver is
 
Download Search Engine Code its free and Search engine is developed in Servlets
Download Search Engine Code its free and Search engine is developed in Servlets Download Search Engine Code Installation Instruction Download and unzip the file into your favorite directory. Create a database on your MySQL Server. Run all the
 
What is Web Hosting
What is Web Hosting What is Web Hosting? What is Web Hosting? If you have a company and want web presence than you need a website. With the website any one from the world must be able to view your pages, images etc. Website is actually a
 
JLAN Server v3.5 - Database Filesystems
*JLAN Server* is a high performance Java based file server supporting Windows file sharing (SMB/CIFS), NFS and FTP protocols.
 
DB Visual Architect for Eclipse
DB Visual Architect for Eclipse (DBVA-EC) is a full featured Object Relational Mapping (ORM) plugin for Eclipse that provides the industry\'s best round-trip code engineering support with Java.
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.