Easy way to migrate MS SQL to MySQL
From:       To:      

Easy way to migrate MS SQL to MySQL

Download  |  Buy  |  FAQ  |  Troubleshooting  |  Release Notes  |  Latest version 8.5 released 04/14/2025

MSSQL-to-MySQL is a tool to automate database migration from MS SQL to MySQL on-premises or cloud. It supports MariaDB or Percona. Depending on privileges on the target server user can either migrate MS SQL data into new database or overwrite the contents of an existing MySQL database.

Features

  • Works with all versions of MS SQL, Azure SQL, MySQL, MariaDB, Percona, Azure for MySQL, Amazon RDS, ClearDB
  • Migrates table definitions, data, indexes, foreign keys and views
  • Spatial data is migrated
  • Safe types mapping
  • High performance of migration due to low-level techniques of reading and writing data
  • ODBC or any other middleware is not required
  • Option to export SQL Server database into MySQL dump file
  • Option to merge or synchronize existing MySQL database with MS SQL data
  • Option to customize resulting table structure
  • Option to filter data using SELECT-queries
  • Command line support
  • Conversion settings are stored into profile to simplify next run
  • Quick Launch
  • The product can be customized according to customer requirements

Limitations

Requirements

Quick Launch

Once the profile is created with conversion settings, user can run the program by double-click on the profile description (.m2s) file in Windows Explorer. This will launch MSSQL-to-MySQL wizard loading the conversion settings from profile. The user will be forwarded right to the screen with conversion progress.

MS SQL to MySQL Migration Tutorial

The process of MSSQL to MySQL database migration consists of the following steps:

  1. Select Conversion Mode
  2. Connect to SQL Server
  3. Connect to MySQL or MySQL script file settings
  4. Select Databases
  5. Conversion Settings
  6. Select Tables
  7. Select Views

Step 1 of 7. Select Conversion Mode

On this wizard page users should select the migration scenario:

  • Move to MySQL server directly - select this option for direct migration into database (access to the target database server is required along with necessary privileges to write into database).

    See Connect to MySQL Server article for more information.

  • Store into dump file - following this approach the program exports database from SQL Server to MySQL script file. This file contains MySQL statements to create tables and to fill them with the data.

    See this article for information about how to import script files to MySQL server.

Step 2 of 7. Connect to SQL Server

On this wizard screen users should provide connection details for MSSQL server.

Enter the name of SQL Server or Azure SQL instance in MS SQL Server field or leave it empty if connecting to the local server. Custom port (other than 1433) can also be specified in this field as follows:

Sql_server_name,1234

where 1234 is the custom port. Then select the type of authentication to use when connecting to SQL Server:

  • Windows authentication - SQL Server validates the connection via Windows user information. The user has to be authenticated by Windows before access is granted.
  • SQL Server authentication - SQL Server will use the standard security validation. To use this option, specify user name and password recognized on the target MS SQL Server.

If connection failed read How to configure SQL Server article for possible workaround.

If you are connecting to Azure SQL, see How to connect to Windows Azure SQL article for related information.

Step 3a of 7. Connect to MySQL

On this wizard screen users should provide necessary information to establish connection to MySQL server. The converter can connect to both on-premises or cloud servers.

By default local connection mode is uses, it is indicated by Local radio button. To connect remotely, select Remote radio button and specify host and port values. Host can be either network name or IP address. Port is necessary only if it differs from the default 3306. If you need to specify custom port for local connection, select Remote and type localhost or 127.0.0.1 into Host box.

Finally, user name and password are entered. If the target server allows anonymous connection, these fields can be empty.

MySQL user should have sufficient privileges to create new database on the target server. Otherwise, it is only possible to import MS SQL data into an existing database.

In cause of error on this stage, refer to the following articles for workaround:

» Can't connect to MySQL server on <host name or IP>
» The program does not support authentication protocol...

Step 3 of 7. MySQL script file settings

On this wizard page users should specify formatting settings for the resulting script file:

  • MySQL version - determines the syntax of SQL statements. Old versions (before 3.23.6) apply more restrictions on syntax of queries. 'Old' syntax is accepted by 'new' versions of MySQL but not vice versa.
  • Line breaks - specifies how to separate text lines in the dump file. 'MS Windows style' option means to use '\r\n', 'Unix style' means to use '\n' as end of line.
  • Add lock for write around 'INSERT' statements - makes import of the dump file into database much faster. To use this feature in MySQL 4.0 and higher it requires global LOCK TABLES privilege and SELECT privilege on the involved tables. In MySQL 3.23 and earlier user also needs to have SELECT, INSERT, DELETE and UPDATE privileges for the tables.

Other options are self-explained. See Import MySQL dump files article to learn how to import script file to the database server.

Step 4 of 7. Select Databases

On this wizard page users should enter the source and target databases or script file (depending on the conversion scenario). Drop down the combo box to see all available MS SQL databases (sufficient permissions are required). Existing MySQL database can be processed as follows:

  • Overwrite the entire database
  • Overwrite existing tables only
  • Skip existing tables
  • Merge
  • Synchronize

Existing MySQL script file is always overwritten.

Specify log file to enable the program write execution traces. It may be used to analyze possible error messages and get more control over the conversion process. If no log file is specified, the logging is disabled.

Step 5 of 7. Conversion Settings

This wizard page is deisgned to customize the database migration using the following settings:

  • Convert views - select this checkbox to convert views
  • Do not migrate the data - select this checkbox to convert only table definitions of MS SQL database. All the data will not be migrated.
  • MySQL character set - tune this parameter to set up correct encoding of text values in the database. Please refer to MySQL documentation to better understand the concept of character sets and collations.
  • MySQL engine type - storage engine determines basic characteristics of handling tables such as storage limits, transaction-safe, locking granularity, etc. Each of them has its own cons and pros. Please refer to MySQL documentation for the further information.
  • Remove schema name - select this checkbox to not prepend target table name with MS SQL schema.
  • Skip converting indexes - select this checkbox if you don't want to convert indexes

Also, here you can specify the MS SQL schema to migrate only tables belong to this schema. Or select "Full Replication" to access all tables of the database. In this case, all table names include schema name as a prefix.

Step 6 of 7. Select Tables

This wizard page is designed to select SQL Server tables for migration to MySQL.

To add new table select it in Available tables list and click Add button (or double-click the highlighted item). Use Add all button to add all available tables. To remove an item from Selected tables list highlight it and click Remove button. Use Remove all button to remove all items from Selected tables list box.

Push Add Query button to add SELECT-query filtering MS SQL data that will be migrated to MySQL server. See Using Queries article for the further information.

The converter allows to edit table or query before migration. For this purpose, double click the corresponding item in Selected tables list box. If it is a table, dialog box appears to edit table attributes and to define custom type mapping. See Edit Table article for the further information.

If selected item is a query, you will see dialog box to edit SQL-statement of the query.

Step 7 of 7. Select Views

On this wizard page users can select views to be migrated. "Available queries" list box contains all available MS SQL views except those are selected already.

To add new MSSQL view for migration, highlight it in "Available queries" list and click "Add" button (or double-click the highlighted item). Use "Add all" button to add all available SQL Server views. To remove an item from "Selected queries" list, highlight it and click "Remove" button. Use "Remove all" button to remove all items from "Selected queries" list.

MSSQL-to-MySQL does not recognize dependencies for views, user should reorder them so that core views go before dependent ones. Highlight the view and use up and down arrows on the right part of the wizard page to change order of conversion.

The converter handles about 90% of syntax constructions involved into MS SQL CREATE VIEW statements. Some of the translation rules are specified in this article.

Types Mapping

SQL Server and MySQL have similar sets of data types, however some of them may require safe mapping. The converter follows these mapping rules:

SQL ServerMySQL
bittinyint(1)
char(length > 255)text
datetime2datetime
datetimeoffsettimestamp
geographylongtext
imagelongblob
money, smallmoneydecimal(18,2)
nchar(length > 255)text
ntextlongtext
nvarchar(length > 255)text
smalldatetimedatetime
textlongtext
time2time
timestamplongblob
uniqueidentifiervarchar(36)
varbinary(max)longblob
varchar(length > 255)text
varchar(max)text
xmllongtext

See full list of safe types mapping

Converting Views

The converter supports about 90% of syntax constructions involved in MS SQL queries. Below there is example of conversion results for the query with few calls of SQL Server embedded functions having no direct equivalent in MySQL.

Here is how it looked into Microsoft SQL:

SQL Server query

And this is the resulting view in destination MySQL database:

MySQL query

Virtual Server

When using a Virtual Server hosting customers may not have sufficient privileges to create new databases on the target MySQL server. For this case we recommend the following approach:

  1. ask your Virtual Server administrator to create blank database on MySQL server
  2. run MS SQL to MySQL converter and select this database as the target of migration
  3. select "Overwrite existing tables only" option when the program asks how to process existing MySQL database

When you complete these steps, the entire contents of the source MS SQL database will be imported into the specified MySQL database.

Demo Version

Still not sure the program fits your needs? Try free demo version of MSSQL-to-MySQL with limited features. It will allow you to convert only 50 records for each database table, it does NOT convert queries/views and foreign keys. Test the quality of the demo and come back to place an order if satisfied with the results.

Purchasing

Select the most suitable option below and click the corresponding BUY NOW link. MS SQL to MySQL converter is covered by 30 day money-back guarantee

Single-user License $79 BUY NOW
Corporate License $199 BUY NOW
MSSQL-MySQL Sync
bi-directional incremental sync between SQL Server and MySQL
$79 BUY NOW
MySQL Migration Toolkit
software pack to convert any data source to MySQL and vice versa
$149 BUY NOW