Import SQL server data to MYSQL

Source: Internet
Author: User
Import SQL server data to MYSQLhi. baidu. comluck001221itemcb4462299f9ea79ab73263d2? Qq-pf-topcqq.group1, go to the mysql official download an odbc driver, because MSsql has not integrated mysql driver, this thing needs to be downloaded separately, and installed. Dev. mysql. comdownloads

SQL Server data import to MYSQL http://hi.baidu.com/luck001221/item/cb4462299f9ea79ab73263d2? Qq-pf-to = pcqq. group 1. Download an odbc driver from the mysql official website. Because MSsql has never been integrated with the mysql driver, this tool needs to be downloaded and installed separately. Http://dev.mysql.com/downloads

Import SQL server data to MYSQL

Http://hi.baidu.com/luck001221/item/cb4462299f9ea79ab73263d2? Qq-pf-to = pcqq. group

1. Go to the mysql official website to download an odbc driver. Because MSsql has never been integrated with the mysql driver, this tool needs to be downloaded separately and installed.
Http://dev.mysql.com/downloads/connector/odbc/5.1.html
I downloaded the windows decompressed package Without installer (unzip in C: \) and did not choose to install it. The green version is better than the installation version. Click a bat file in install.
2. If the installation is successful, there is an option in the ODBC data source driver, for example:


3. Click the user dsn to add a mysql connection, provided that you have a mysql database.


The following prompt box is displayed after double-clicking:



Ah, ha, half done.

4. If DTS is used for SQL server2000, it can be used directly. The key steps are as follows:



The following interface is very familiar:


OK is imported.
Of course, you can also use the File dsn to save the connection string as a file, and then select the file dsn during import. You only need to find the path of the connection string ..

5. If you are using SQL2005 ssis, it is a bit disgusting. Here I want to emphasize:

I hate data transmission in sql2005. I hope Microsoft can see it.


The dsn here needs to be manually written and cannot be directly read from odbc. This function is very practical and will not cause many misunderstandings. But there is no such thing in 2k5. It's hard to understand why Microsoft's guys eat it.
Don't think you have succeeded. Click Next. Click Next. Wait.

You can only select-write a query to specify the data to be transmitted. Vomiting blood .. There are more than 200 tables. What about tmd?
After testing, neither the file dsn nor the system dsn Selects all the tables. If the file dsn is selected and the connection string is used, this error is reported:


I hate the DTS function of SQL Server 2005 very much. It is an idiot to design engineers of Microsoft SQL Server.

I decided to use 2 K.

I tested 2008, huh. 2008 this function is available ,:

Migrate data from SQL Server to MySQL

Http://www.cnblogs.com/gaizai/p/3237907.html

I,Background

Since the database used at the beginning of the project is SQL Server, and then the stored database is changed to MySQL, the data of SQL Server needs to be transferred to MySQL; because there are many tables involved, therefore, we want to generate the corresponding table in MySQL and import data;

I found some information online, such as importing ACCESS and MSSQL into MYSQL and MySQL Migration to migrate data from MSSQL to MySQL. Although I do not know whether the above practices can be transferred successfully, however, the process is complicated and I did not try it. Later I found the method. The most important thing was simplicity and accuracy (no obvious bugs were found at the moment). I would like to share it with you here.

II,Transfer Data

I used SQLyog, the MySQL Client tool, which is easy to install. After the installation is complete, click the target database to be imported, and right-click Import> Import Extenal Data ];

(Figure1: Import)

Select Start a new job and click Next ];

(Figure2: Start a new job)

The following figure shows the DSN settings page. If you do not need to export the DSN of the SQL Server database from the list, create a New DSN to connect to the SQL server;

(Figure3: Create a New DSN)

(Figure4: Create a new data source)

(Figure5: select the data source type)

Save the preceding settings as a local. dsn File;

(Figure6: select the data source storage path)

(Figure7: Select SQL Server)

(Figure8: Set the SQL Server account and password)

(Figure9: Select SQL Server database)

(Figure10: Test Data Source)

(Figure11: test successful)

Select File DSN. In the browser, select the DSN we just created, and enter the account and password used to log on to SQL Server;

(Figure12: Select DSN)

Next, select the target MySQL server, enter the IP address and account password, and select the target database;

(Figure13: Set the MySQL account and password to the target database)

This step is similar to the SQL Server Import and Export function. You can copy a table or use an SQL script to filter data;

(Figure14: Table copy)

The entire process above is to create an SQL Server and MySQL pipeline. Next, we will set the correspondence between the SQL Server table and the MySQL table; the ing between SQL Server table fields and MySQL table fields is included in [Map], the Advanced option [Advanced], and the filter [WHERE ].

(Figure15: select the table ing)

In Figure16, the data Source [Source] describes [Destination]. Pay special attention to the Data Type [Type] here, which means to convert the Data Type of the target, but it does not need to be the same as that of the target table, this is used as a temporary storage data type, similar to that of FindOn in SQL Server, which is converted to MySQL timestamp. In fact, the Data Type of the MySQL target table is datetime, this setting can also be converted successfully.

(Figure16: Table field conversion)

(Figure17: advanced options)

(Figure18: Error)

(Figure19: Log)

(Figure20: Execution Information)

(Figure21: execution result)

(Figure22: Data list of the original SQL Server)

(Figure23: list of data transferred to MySQL)

Compared with Figure20 and Figure21, we found that all data has been transferred successfully;

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.