Method 1:
1. Guide table structure
Methods to generate create scripts using MySQL. Find the script to generate and export, and modify it according to the MySQL syntax to create the column structure of the table in the MySQL database.
2.Table data
Export text files using bcp on the MSSQL side:
bcp "Select * FROM ;" queryout -c -Slocalhost\db2005 -Usa
Among them, "" is the SQL statement to be exported, -c specifies that use \t for field separation, use \n for record separation, -S specifies the database server and instance, -U specifies the user name, and -P specifies the password.
Use mysqlimport to import text files into the corresponding table on the MySQL side
mysqlimport -uroot -p databasename /home/test/
Where -u specifies the user name, -p specifies the password, databasename specifies the database name, and the table name and file name are the same.
Method 2:
The MYSQL Migration Toolkit should be available.
1. Install the MySQL Migration Toolkit on a machine running MS SQL server;
2. This machine also needs to install the java environment and jdbc driver:
Download the Java environment on the Sun website, and download the jdbc driver on the MySQL website (mysql-connector-java-5.0.), and set the path environment variables;
3. If you have Chinese characters in your original database, you must explicitly set several places related to the character set:
A. Source Database Select Database System to MS SQL:
Here you need to manually write the jdbc connection string: click on the Advanced key at the bottom of the interface, and a box appears, prompting to enter "Connection String:", enter the following format here:
jdbc:jtds:sqlserver://IP:PORT/YOURDB_NAME;user=USER;password=PASSWD;charset=gb2312(or gbk);domain=
Among them, capital IP, PORT, YOURDB_NAME, USER, and PASSWD must be filled in with the IP and port, database name, database user name, and password of the actual MS SQL Server server;
B. Target Database also requires manual editing of jdbc connection string:
Click the Advanced key at the bottom of the interface, and a box appears, prompting to enter "Connection String:"
Enter the following format here:
jdbc:mysql://IP:3306/?user=USER&password=PASSWD&useServerPrepStmts=false&characterEncoding=gbk
Among them, capital IP, USER, and PASSWD must be filled in with the IP, database username and password of the actual MySQL server.
C. Select the schema and table of the sql server
D. Object Mapping
Modify "Migration of type MSSQL Table":
Click "Set Parameter", select "User defined", set "charset=gb2312(or gbk), collation=gb2312(or gbk)_chinese_ci"
E. There are no other options afterwards, until the end
F. After the porting is completed, you can see Chinese by using graphics tools (MySQL query browser, SQLyog, etc.) or using mysql client (command line).
On the client (command line), execute first
mysql> set names gb2312(or gbk);
4. Since MS SQL server and MySQL have certain differences in syntax format and data type definition, the migration process is not very simple, and it may need to be repeated several times to correct the syntax format and data type definition. MySQL Migration toolkit allows users to manually modify the generated MySQL SQL statements in the "Manual Editing" section
Method 3:
On the 13th, Microsoft released the latest dedicated conversion tool, the following is the address, which supports mysql to 2005 or 2008
https:///database/
Official download address
/downloads/?FamilyID=c6f14640-da22-4604-aaaa-a45de4a0cd4a&displaylang=en
1. Guide table structure
Methods to generate create scripts using MySQL. Find the script to generate and export, and modify it according to the MySQL syntax to create the column structure of the table in the MySQL database.
2.Table data
Export text files using bcp on the MSSQL side:
bcp "Select * FROM ;" queryout -c -Slocalhost\db2005 -Usa
Among them, "" is the SQL statement to be exported, -c specifies that use \t for field separation, use \n for record separation, -S specifies the database server and instance, -U specifies the user name, and -P specifies the password.
Use mysqlimport to import text files into the corresponding table on the MySQL side
mysqlimport -uroot -p databasename /home/test/
Where -u specifies the user name, -p specifies the password, databasename specifies the database name, and the table name and file name are the same.
Method 2:
The MYSQL Migration Toolkit should be available.
1. Install the MySQL Migration Toolkit on a machine running MS SQL server;
2. This machine also needs to install the java environment and jdbc driver:
Download the Java environment on the Sun website, and download the jdbc driver on the MySQL website (mysql-connector-java-5.0.), and set the path environment variables;
3. If you have Chinese characters in your original database, you must explicitly set several places related to the character set:
A. Source Database Select Database System to MS SQL:
Here you need to manually write the jdbc connection string: click on the Advanced key at the bottom of the interface, and a box appears, prompting to enter "Connection String:", enter the following format here:
jdbc:jtds:sqlserver://IP:PORT/YOURDB_NAME;user=USER;password=PASSWD;charset=gb2312(or gbk);domain=
Among them, capital IP, PORT, YOURDB_NAME, USER, and PASSWD must be filled in with the IP and port, database name, database user name, and password of the actual MS SQL Server server;
B. Target Database also requires manual editing of jdbc connection string:
Click the Advanced key at the bottom of the interface, and a box appears, prompting to enter "Connection String:"
Enter the following format here:
jdbc:mysql://IP:3306/?user=USER&password=PASSWD&useServerPrepStmts=false&characterEncoding=gbk
Among them, capital IP, USER, and PASSWD must be filled in with the IP, database username and password of the actual MySQL server.
C. Select the schema and table of the sql server
D. Object Mapping
Modify "Migration of type MSSQL Table":
Click "Set Parameter", select "User defined", set "charset=gb2312(or gbk), collation=gb2312(or gbk)_chinese_ci"
E. There are no other options afterwards, until the end
F. After the porting is completed, you can see Chinese by using graphics tools (MySQL query browser, SQLyog, etc.) or using mysql client (command line).
On the client (command line), execute first
mysql> set names gb2312(or gbk);
4. Since MS SQL server and MySQL have certain differences in syntax format and data type definition, the migration process is not very simple, and it may need to be repeated several times to correct the syntax format and data type definition. MySQL Migration toolkit allows users to manually modify the generated MySQL SQL statements in the "Manual Editing" section
Method 3:
On the 13th, Microsoft released the latest dedicated conversion tool, the following is the address, which supports mysql to 2005 or 2008
https:///database/
Official download address
/downloads/?FamilyID=c6f14640-da22-4604-aaaa-a45de4a0cd4a&displaylang=en