The actual operation of converting MSSQL to MySQL database records

Source: Internet
Author: User

The following articles mainly describe the actual operation procedures of some records of MSSQL to MySQL database, as well as the problems found in the actual operations, including the problem of table creation and coding, the following describes the main content of the article. I hope you will find some gains.

Today, I converted an MSSQL database into MySQL. Without a conversion tool, I used the following method to convert data tables with few fields. MSSQL uses the Enterprise Manager and MySQL uses phpmyadmin.

1. Use the MSSQL Enterprise Manager to open the table structure (design table). locally, use phpmyadmin to create one table based on the structure, optimize the table data fields, and create the table.

2. Use the Enterprise Manager to export a single table, select text from the import source, and select the separator. The original value is ',', because phpmyadmin defaults to;, so select here ;. Export a text file.

3. Use the single-Table import function of phpmyadmin. Select the following CSV file and use load data to import the table content.

Done!

If there are many fields or a large number of records, this method is not applicable and you need to use software to help. Currently, as far as enjoy knows, there are two good software that can convert MSSQL into MySQL. One is DBConvert for MSSQL & MySQL, which can be converted to more than 10 MB in two directions. One is MSSQL to MySQL, which is very small and has more than 1 MB of compressed packages. It can specify which tables of a database are imported into SQL, or directly to MySQL, which is quite useful.

I used MSSQL to MySQL to change an MSSQL database to SQL, and found the following two problems in actual operations.

1. Table creation issues. The generated table creation SQL specifies ENGINE = INNODB. I used the MYISAM type and gbk encoding, and changed it:

 
 
  1. ENGINE=MYISAM DEFAULT CHARSET = GBK 

2. Encoding Problems. My database is gbk encoded, and the -- default-character-set = gbk option is added during import, so that Chinese characters can be displayed normally.

 
 
  1. MySQL --default-character-set=gbk -D DBNAME < E:\hx\9enjoy.txt -uroot -p 

The above content is an introduction to some records of MSSQL-to-MySQL databases. I hope you will have some gains.

The above content is a description of some records that MSSQL converts to the MySQL database, hoping to help you in this regard.

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.