MySQL: volcado de la base de datos

Para poder hacer volcados de la base de datos de forma automática (o manual), podemos usar el comando mysqldump. Para volcar toda la base de datos, ejecutaremos:

# mysqldump -A -c –user=root –password=password_de_root > copia_seguridad.sql

A nota de comentario, la restauración de un export hecho en una versión anterior y pasado a una posterior puede traer problemillas. En su momento lo siguiente me ayudó:

If you receive some errors such as the following when trying to import your mysql database dump you are most likely attempting to dump a database from a newer version of MySQL and import it into an older version:

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘DEFAULT CHARSET=latin1′

OR

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘DEFAULT CHARSET=utf-8′

Solution?
Add the following parameter to your msyqldump statement:

–compatible=mysql40

Deja un comentario