How to quickly migrate a TB-level mysql database?

In the field of big data, terabyte-sized databases are not an exaggeration at all. This is the case for one of my customers. I originally used Tencent Cloud's cloud server, but the configuration was not enough, so I considered switching to an independent physical machine again and again. But migrating the database has become a big problem! After many attempts, the current method may be the fastest!

Method 1: Use the ssh command to export the database of the old server into a sql file. This is indeed fast, but importing it here is a big problem. First of all, it is very difficult to download sql files of hundreds of gigabytes, and then navicat can import the data at ordinary computers. Unable to import and stuck! Unless you have a high-configuration physical server with a memory of not less than 1000G at home, this is unrealistic. Even if you have it, it will take ten days and a half! Not recommended!

Method 2: Use navicat to export data by table into csv or DB files. If a single table has more than 50 million data, cut and export based on 50 million. This method is not recommended. Although the success rate is much higher than method 1, it still works. The volume is too large, because many single tables are worth one to two billion. It is a nightmare to cut forty or fifty files from one table and then import them later. The higher the success rate, the lower the computer requirements, but the time is shorter. It is several times the cost of method 1 and is not recommended!

Method 3: Migrate using the migration tool that comes with the Pagoda panel. This is the least recommended method. Pagoda’s migration tool is simply helpless with these big data. Not to mention the TB level, the GB level is even difficult to withstand, although the prompt says It was successful, but the data was not migrated successfully!

Method 4: Directly copy the original database files to the new server. There are many similar tutorials on the Internet, but please remember that this method is only applicable to mysql5.6 and 5.7 and must be the myisam database engine. 8.0 has been completely reconstructed. Even this method of the myisam database engine will not work<

Guess you like

Origin blog.csdn.net/BenChiZhuBaDaoWang/article/details/132425418