Demonstration of converting MSSQL data to MySQL database

Source: Internet
Author: User

This article mainly introduces the operation method for converting MSSQL data to MySQL database (MSSQL2MYSQL). It has been a long time to solve this problem, however, it cannot be solved yet, but at least list the feasible methods and methods I have tried before.

DBConvert for MSSQL and MySQL tools should be used at the earliest, but I don't know why I cannot connect to my MSSQL. It may be 2005. The link 2000 seems to be very OK, because I tested that the connection to the virtual host MSSQL2000 was completely normal, and the connection to the local MSSQL2005 failed, there was no way to give up.

Then I continued to find a method and found that I did not find any Chinese materials (that is, the Chinese webpage found by Google), which gave me good results, it is best to use an English keyword for search:

Convert mssql to mysql turned out to be the first official page of the MYSQL database. After going in and browsing it, I found that it was very good and basically solved my problem and proposed five methods, the Chinese Web pages I searched for are basically solved by using ODBC tools, and even code is not useful. It's really a gap.

The article provides the following five methods: migrating from Microsoft SQL Server and Access to MySQL ):

 
 
  1. MSSQL2MYSQL   
  2. Microsoft DTS   
  3. SQLyog   
  4. Access Export   
  5. Text Import/Export  

I think we should use ODBC for MYSQL tools for the above conversions. Therefore, please download and install them on your own and restart your computer before using the above methods.

Microsoft DTS should be the built-in import and export tool of MSSQL. MSSQL is good in terms of import and export ACCESS and text, but ODBC is not found in the import and export tool of MSSQL2005, dizzy enough, isn't it? It seems that you still need to check the documentation.

Access Export is the Access Export tool. When exporting data, select ODBC. Of course, you must configure the ODBC parameters of MYSQL first.

SQLyog is a MYSQL management tool. It is not tested because it is too lazy to download it.

Text Import/Export: I can Import Text files in phpMyAdmin, which may be suitable for a small amount of data. It is not very convenient for a large number of tools.

MSSQL2MYSQL is a VB Code. For all the code, see http://www.kofler.cc/mysql/mssql2mysql.txt. Copy the code to the VBA or VB class module and set the parameters according to the instructions. The data conversion process starts when running. It is worth noting that different database engines use different field types, So field type conversion is involved, but this code has solved this problem, therefore, you don't need to consider data conversion, but I will never change the basic data type to the image type, and so on. So I don't think it has much to do with me.

I opened VB6 and set the parameters to run it again. You can use it to prepare for writing a tool. It turns out that someone else has provided a third-party GUI tool. Alas, I knew I would just go through the GUI tool and try again without having to be so tired.

OK. There is a GUI versions section below. Here we provide two MSSQL2MYSQL GUI tools, both of which are relatively simple. Let me briefly talk about the parameters, the link parameters of MSSQL and MYSQL databases are all I want to know. The drop database parameter indicates that the database in MYSQL is deleted before conversion, so that the database can be cleaned up, therefore, if you want to convert to an existing database, you need to note that verbosity is actually the output option. Is it a conversion to the database or an SQL file?

1 For the output file, 0 for direct import to MYSQL, the rest of the nothing to say, character encoding in general I want to also use UTF-8. Think about the rest.

The efficiency of MSSQL2MYSQL is really disappointing. Although such a method is found, the real conversion is not just a pain point. In the above MSSQL2MYSQL code conversion method, the efficiency is about 5000 records per hour, and the use of Access Export does not seem to be much faster. Do you want to know that I have 6 million records? Crazy.

It seems that you have to find another method. However, it takes more than half an hour to import 6 million records to SQL SERVER using the BCP ing method, the SQL server export function is used to export the database as ACCESS, and the time is not short. The last wait is not patient, so I have to go to bed on the computer.

This is probably the method of MSSQL2MYSQL database I have tried at this stage. If you have a friend who has a better and faster method, please let me know. Thanks for the update: It may prompt you that you cannot connect to MYSQL, this part may be related to the mysql odbc you installed, because the default setting text seems to be faulty. I set the ODBC version to "MySQL ODBC 5.1 Driver" so that the connection can be established. Maybe the new version of mysql odbc has been updated, but the code is still in the old version, so it is not supported.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.