Mssql data import to MySQL database

Source: Internet
Author: User

The following articles mainly describe the actual operation methods for mssql data to be imported into the MySQL database, and describe some matters worth your attention when importing mssql data into the MySQL database, I hope it will help you in this regard.

Abstract: [NULL]

To migrate web applications from asp/mssql to the php/MySQL database, you need to import data from mssql2005 to MySQL5.0. There are many data import methods on the Internet. The most direct statement is to install myODBC, add a data source to the control panel and directly export it. However, myODBC cannot be installed for several versions. In mssql2005, the data source cannot be generated.

In addition, access can be imported from mssql, And the myODBC data source can be used in access (2007), but sometimes garbled or inexplicable errors.

You can also write your own programs, such as php programs and use Program guidance. This speed is not very fast. You have to write code. It is very tired. Every time you export a table, you need to write a table and code; writing General programs is too troublesome. After exploration, you can use the following methods to import data, which is a little more complex, but feels faster.

Use the CSV import function of MySQL to export DATA to the csv format, create a table in the MySQL database, and use the load data statement of MySQL to import csv DATA.
The details are as follows:

1. First export data from mssql to the flat file format: Pay attention to two points here. Select unicode and set the text qualifier ()

2. Use mssql to generate the create table statement for TABLE creation. Modify the statement to change it to the create table statement for MySQL database. You can use a text editor (such as UE and editplus) to replace the field types, square brackets, and other useless junk information in batches. Note that the text field must use utf8 and utf8 in a unified manner, so garbled characters are not easy (it is best to specify the default format as utf8 when creating a database, so that you do not need to specify the sorting type for each field ).

3. Create a table in MySQL. You can use phpmyadmin to directly run the table creation SQL.

4. To organize csv data, you need to convert the csv data to UTF-8 format. I use ue studio. If there are no other tools, you can use notepad that comes with windows.

5. import DATA in phpmyadmin: Use the csv load data statement and change "field separator" to comma ','. Browse to the csv file and import it.

Note: The default maximum size of the uploaded php file is only a few MB. You need to modify a php. ini file to make it larger. Otherwise, you cannot import big data.

The above content is an introduction to the methods for importing mssql data into the MySQL database.


 

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.