简体   繁体   English

可以将MySQL 32位数据库导入/复制到64位MySQL吗?

[英]Can a MySQL 32bit database be imported/copied to a 64bit MySQL?

I have a database on a 32bit Linux server with MySQL that I would like to import/copy/migrate to a 64bit Linux server. 我在32位Linux服务器上有一个MySQL数据库,我想将数据库导入/复制/迁移到64位Linux服务器上。

I have considered 我考虑过

service mysqld stop
tar czf /root/db.tar.gz /var/lib/mysql

and copy this to the new server. 并将其复制到新服务器。

Or perhaps 也许

mysqldump -uroot -p --all-databases > /root/db.sql

Question

Is that possible, and if so, what the recommended way? 有可能吗?如果可以,推荐的方法是什么?

Using mysqldump and re-importing the resultant file will work for certain and is recommended, unless your database is very large and the dump/import process' slower speed is an issue. 建议使用mysqldump并重新导入结果文件,这种方法一定可以使用,因此建议这样做,除非您的数据库很大并且转储/导入过程的速度较慢是一个问题。

Unless the server environment is identical in most ways, you may have some cleaning up to do and permissions corrections if you were to copy the data files over directly. 除非服务器环境在大多数方面都相同,否则,如果要直接复制数据文件,则可能需要进行一些清理工作和权限更正。 There is documentation on performing the transfer with raw data files, but mysqldump is the usual preferred method. 关于使用原始数据文件执行传输的文档,但是mysqldump是通常的首选方法。

If you have a large database, I would suggest using XtraBackup . 如果您的数据库很大,建议您使用XtraBackup It will likely be much faster than using mysqldump followed by an import. 它可能比使用mysqldump随后的导入快得多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM