How to export sqlserver data to a MYSQL database

Source: Internet
Author: User

Now more and more friends are using mysql databases. Sometimes we need to convert asp to php so that we need to convert sqlserver data into mysql databases, after searching, we found that mysql officially provided professional work.


Use official tools

1. Install mysql database ODBC driver, mysql official website has download http://dev.mysql.com/downloads/connector/odbc/

2. Open the control panel, administrative tools, and data source ODBC, and add a MySQL ODBC data source to the user DSN.

3. enter the name of the data source in the following form, such as mysqlodbc. Then, enter the Server address (localhost or other), User, Password, and Password. Enter the correct address and select the database to be imported. Set the port and Character Set used by MySql in connect options as needed. The character set must correspond to the Mysql Server. If Mysql uses the gbk character set, you must set the character set to gbk. Otherwise, the question mark may be garbled during import to SQL Server.
4. Open the SQL server Enterprise Manager and create a new MySql database. Right-click the database and select all tasks/import data.
5. select another data source (ODBC data source), and the user/system DSN is mysqlodbc. Other data can be imported from the MySql database to the MSSQL database according to the wizard.

The database imported to SQL Server may have some table errors. For example, the table data is not imported, the table primary key is not set, and the field format is incorrect. You need to reset or insert it again.


Import MySql database to MSSQL database

1. Install ODBC driver for mysql database, mysql-connector-odbc-3.51.19-win32.msi

2. Open the control panel management tool data source ODBC and add a MySQL ODBC 3.51 data source to the user DSN.

3. On the log in login tab, enter the Data Source Name. Here, enter MysqlDNS. Then, enter the server, User, and Password. Enter the correct Password and select the database to import. Set the port and Character Set used by MySql in connect options as needed.

Note: The character set must correspond to the Mysql server. If Mysql uses the gbk character set, set the character set to gbk. Otherwise, the question mark may be garbled during SQL import.

4. Open the SQL server Enterprise Manager and create a new MySql database. Right-click the database and select all tasks to import data.

5. select another data source (ODBC data source), and the user/system DSN is MysqlDNS. Other data can be imported from the MySql database to the MSSQL database according to the wizard.

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.