Wednesday, January 13, 2010

Savanna Does Dale Samson

Creating backups with mysqldump

if Not that the vast majority of the systems must have a subsystem to generate backups of the information handled and which may subsequently be used in the event of any loss of relevant information. In this post I'll talk a little about mysqldump that lets you create fast backups of our databases.

mysqldump is a command that comes with managing MySQL databases, which allows us to make a backup of the databases the system as a whole or only some tables that we are interested in supporting. On the Internet you can find much information about using this command. You will only discuss how we can support a database in a plain text file and then retrieve the information we have supported.

To be used mysqldump is inside the bin folder of MySQL.

Windows: C: \\ Program Files \\ MySQL \\ bin \\ mysqldump

In Ubuntu: ; / usr / bin / mysqldump

Obviously, the location may vary depending on the installation process of each person.

Al mysqldump we can send some parameters to perform specific tasks, some of these parameters are:


- databases (databases) Copy all databases.
- opt (Optimization) It allows you to backup quickly.
- user (User) Specify the administrator user name system database.
- password (Password) You specify the administrator password.
- tables (Tables) Override option databases. You can specify the tables you want to support a database.

More parameters can be sent to mysqldump can be found in the reference page about this command.

Examples of using mysqldump:

a) Supporting all database called Customers.

mysqldump - opt - user = user - password = password Clients> / home / username / Desktop / respaldo.sql

b) Support the tables and Sales Directory database customers.

mysqldump - opt - user = user - password = password - Customers tables Directory Sales> / home / username / Desktop / respaldo.sql

Now, to retrieve information from the generated files and load the database using mysql command as follows:

c) Restoring the backup file and upload the information respaldo.sql the Customers database.

mysql-u username-p Customers \u0026lt;/ home / username / Desktop / respaldo.sql

the process for Windows is similar, only there to replace the file paths that we generate.

0 comments:

Post a Comment