Import database MySQL File-Per-Table Tablespaces to Same Server

时间:2015-10-06 08:39:56

标签: mysql innodb mysqldump mysql-backup

Is necessary copy a database within a single server. Was chosen way to "File-Per-Table Tablespaces to Another Server" as it is the fastest for large databases.

The official documentation states that the database name must be the same on the source server and the destination server.

What if the source server and the destination server - this is one and the same server?

Is there any way in order to be able to copy the database files from one database to another within a server quickly.

Or somehow a way to get "File-Per-Table Tablespaces to Another Server" to ignore the name of the database?

Info server: OS: MS Windows Server 2008
MySQL Server: MySQL 5.5 or MariaDB
Tables Type: InnoDB (if MariaDB - InnoDB plugin)

Portability Considerations for .ibd Files When you move or copy .ibd files, the database directory name must be the same on the source and destination systems. The table definition stored in the InnoDB shared tablespace includes the database name. The transaction IDs and log sequence numbers stored in the tablespace files also differ between databases.

1 个答案:

答案 0 :(得分:0)

EDITED:

I would create the backup files as suggested in the method, but would also export the schema as create table statements. After the backup I would use the rename table command to move the existing files to another database. Then Iwould recreate the schema in mz current database using the create table statements and then would import back the namespace as described.