sql - Easiest way to copy a MySQL database? -


Does anyone know an easy way to copy files from a computer to a file, and then on another computer Import?

Here are some options:

mysqldump < / P>

The easiest, guaranteed way of working is to use mysqldump . See the manual page for the utility here:

Basically, this SQL script is necessary to rebuild the contents of the database, including tables, triggers, and other objects and data Inclusion (this is all configurable, so if you have a schema set up elsewhere, you can just dump the data).

Copying personalized Massage table files

If you have large amounts of data and you store MyISAM for tables If you are using the engine you want to copy, you can just close mysqld and copy. Frm, .myd, and .my files from one database folder to another (even on any other system). It will not work for Indiabi tables, and can not work for other storage engines (with whom I am less familiar).

mysqlhotcopy

If you have to dump the content of the database while the database server is running , you mysqlhotcopy (note that this only works for MyISAM and the archive table):

Copying the entire data folder < / Strong>

If you are copying the installation of the whole database, Therefore, all the databases and content of every database, you can simply close mysqld, your entire MySQLEta Directory Zip, and copy it into the data directory to the new server.

This is the only way (which I know) to copy INODB files from one instance to another, this will work fine if you run between the same OS family and the server running the same version of MySQL Are; It may be work to run between the operating system and / or MySQL versions; From the top of my head, I do not know.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -