In the previous article, we talked about how to use NavicatPremium to import data perfectly when mssql data is converted to mysql data, but the data type conversion is not perfect when creating a table, in this article, we will discuss how to use the mss2sql tool to create tables. By the way, to import data, we need to use the mysql database to create a small project using ruby on rails. The data in the project already exists, it is only stored in SQL Server, but rails can be used to operate SQL Server, but it is not very well matched. if you want to use it after conversion, there are many conversion methods after turning it over online, using ODBC and PHP programs to write SQL code, I think the conversion is still a tool. first, I tried to use ODBC, it is found that SQL Server's export function is not very good for mysql ODBC
ODBC is divided into 32-bit and 64-bit. it starts with 32-bit. it cannot be displayed on Win7 64-bit. you can choose to add it only after downloading the 64-bit version from the mysql official website.
32-bit version:
Http://www.bitsCN.com/database/142740.html
64-bit version:
Http://www.mysql.com/downloads/connector/odbc/
After clicking finish, you need to select your mysql database source
In this way, you can see it in ODBC.
Unfortunately, the data exported from SQL server cannot be converted, and the architecture does not match.
No way, continue searching on the internet and find a blog saying that mss2sql can be used for conversion. The result is successfully converted on win7 64-bit:
Mss2sql: http://www.bitsCN.com/softs/209207.html
Open the compressed package after the download
Run mss2sql
The default value is Move to MysQL server directly. select next.
Continue to the next step. wait a moment.
This time, I need to connect to the MySQL server. I am Local, so I chose Local and enter your username and password.
Continue waiting for connection
Select the database to be converted in MS SQL
Click next. if there is a database with the same name in mysql, you will be asked to select the conversion method, which is
Overwrite the entire database: Overwrite the entire database Overwrite existing tables only: only Overwrite the existing table Skip existing tables: Skip the existing table Merge: Merge
I only have an empty database in mysql, so I chose the first item, covering the whole.
Select the table to be converted and Add it to the conversion list. I need all the tables, so I chose Add all
Then there is a period of waiting.
There is not much data in this table, and it takes a little longer, about 10 minutes. if the table is large, it may be faster to use a program for conversion. thank you for your convenience.
The following figure shows the table after the conversion. The data in the table is OK and there is no problem with Chinese.
The operating environment for this article is:
Win7 64-bit, SQL server 2008 express, Mysql 3.23.49, apache 1.3.33,