Get the App
SLTechnology News&Howtos  ›  Database  › 

How to migrate sqlserver data to mysql database

Shulou Source: shulou.com Published: 2022-05-31 18:07:46 09月19日 Update

This article mainly explains "how to migrate sqlserver data to mysql database". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's ideas to study and learn "how to migrate sqlserver data to mysql database".

In project development, sometimes because the database used at the beginning of the project is SQL Server, and then the stored database is adjusted to MySQL, so the data of SQL Server needs to be migrated to MySQL. The following is the editor's daily arrangement of a method of sqlserver database migration.

1. The common data types in SQL Server are different from those in MySQL.

2. Some problems that should be paid attention to when migrating SQL Server data to MySQL.

1. Different from the unique index, the field of the unique index of sql server can only allow one null value, while the field corresponding to the unique index of mysql and oracle allows multiple null values.

2. The syntax of stored procedures is very different, and the migration of stored procedures is the most troublesome and needs to be carefully modified.

3. Some SQL statements written in the program should be modified accordingly due to different syntax.

Third, common methods of migrating SQL Server data to MySQL

1. Use SQLyog to migrate

Advantages

The migration method is simple and flexible. When you migrate, you can modify the fields. For example, you can configure timest with a high success rate when you migrate from datetime to mysql in sql server.

Shortcoming

The migration is slow! This is the biggest disadvantage of this method. If the data volume of the table reaches hundreds of thousands or even millions of rows, you will find that the migration is really slow. Obviously much slower than other migration methods.

2. Use the script export function of powerdesigner and sql server to migrate

The main contents of this paper are as follows: (1) this method first uses powerdesigner to reverse engineer the sql server database to get the Emurr diagram, and then generate the table-building statement of MySQL. Complete the migration of the database structure; of course, it is possible to migrate the table structure without using powerdesigner. For example, I export the table structure into idioms, modify it manually, and then run it in MySQL. It's the same thing.

(2) then use the tool SSMS of sql server to export the data of the tables in the sql server database into insert statements, and each table corresponds to export a file, then do some processing to the file, and then import it into the MySQL database.

3. Use Oracle MySQL Server's official workbeach tool for migration

(1) when workbench connects to sql server, the user needs the permission of view any database. Otherwise, workbench cannot access the metadata of sql server's table structure and cannot be migrated.

(2) there is also a way to use Navicat for migration, which is similar to SQLyog.

Thank you for reading, the above is the content of "how to migrate sqlserver data to mysql database". After the study of this article, I believe you have a deeper understanding of how to migrate sqlserver data to mysql database, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Data databases methods different structures statements fields indexes storage learning content tools files shortcomings syntax procedures problems projects large obvious Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux macOS MariaDB Docker MySQL