English 中文(简体)
Migrate Data and Schema from MySQL 至服务器
原标题:Migrate Data and Schema from MySQL to SQL Server

www.un.org/Depts/DGACM/index_spanish.htm 是否有自由的解决办法,自动将MySQL数据库迁移到服务器,“建筑工程”

我每天都在尝试这一简单(至少我认为如此)的任务。 我尝试:

  1. SQL Server Management Studio s Import Data feature
  2. Create an empty database
  3. Tasks -> Import Data...
  4. .NET Framework Data Provider for Odbc
  5. Valid DSN (verified it connects)
  6. Copy data from one or more tables or views
  7. Check 1 VERY simple table
  8. Click Preview
  9. Get Error:

The preview data could not be retrieved. ADDITIONAL INFORMATION: ERROR [42000] [MySQL][ODBC 5.1 Driver][mysqld-5.1.45-community]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near "table_name" at line 1 (myodbc5.dll)

如果我穿过其他izar子并从事行动,就会出现类似的错误。 失败的一步是“解决源联线”,错误指的是检索一栏信息,然后列出上述错误。 当我修改一栏地图时,它可以检索一栏信息,这样我确实不知道问题是什么。

我也尝试获得各种MySql工具,以制作SQ服务器理解但 t机成功的dl声明。

我先与MySQL诉5.1.11至QL 2005年服务器和MySQL诉5.1.45至2008年服务器(分别有ODBC司机3.51.27.00和5.01.06.00)一起尝试。

最佳回答

微软提供了两个免费工具包。

  1. Microsoft SQL Server Migration Assistant for MySQL v1.0 http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=14280

  2. Microsoft SQL Server Migration Assistant for MySQL v5.1 http://www.microsoft.com/download/en/details.aspx?id=26712

I have used only the second one and it worked for me without any glitch. It required registration with Microsoft for downloading a license file. But it is free to use for everyone.

问题回答

现在,这确实是老的,但如果你使用MySQLLinkor NET,并设置SQL普服务器将解决你的错误。

最近,我成功地将MySQL数据库迁移到了MSSQL数据库。 详细步骤如下:

<Operating System: AWS 微软Windows 2012 R2 with服务器 Standard

www.un.org/Depts/DGACM/index_spanish.htm 工具:

  • SQL Server 2014 Management Studio SQL Developer,
  • Microsoft SQL Server Migration Assistant v6.0.1 for MySQL,
  • Remote Desktop Client, and
  • Third Party MySql ODBC Driver 5.1.13

1. Setup AWS Windows Server enter image description here

2. From the AWS console ec2 instance list, right click on the windows server and select connect. You would see the similar screen below. enter image description here

3. Click on the Get Password button, which will be required forchy部 connection[#4] and follow the Directive.

4. Connect to that EC2[#1] instance with the Remote Desktop Client by default available in your Ubuntu local machine. Use the credentials from #2. enter image description here

<>5>。 一旦你利用遥远的客户连接,你就应当能够使用远程的中高频雷达服务器。 包含以下工具:。

6. Configure ODBC Data Sources (64-bit) :

  • Open Administrative tools → click on ODBC Data Sources(64-bit) and follow the steps to connect to MySQL database.

7. 开放服务器2014年管理室 利用窗口认证进行开发和连接。

  • Create destination MSSql database for MySql migration.

8. 开放式微软服务器移民助理: 详细访问这一链接:https://blogs.msdn.microsoft.com/sma/02/07/mysql-to-sql-server-migration-how-to-usesma/

  • Create new project
  • Connect to MySql
  • Connect to MSSql
  • Convert Schema
  • Migrate Data

8. You might have some problem listed here. Please read in detail where I have written the detail resolution. MySql 5.6 to MSSql server 2014 migration : ExecuteReader requires an open and available Connection

I am afraid there is no simple solution. SQL used in MySQL and T-SQL used in SQL Server 200X are different dialects of SQL. It is not only simple changing say "auto_increment" to "identity", but reserved words that creates a problem. For example

   CREATE TABLE test (
 user varchar(50)
  )

will work in MySQL and fail in SQL Server 2008. To cut long story short - unfortunately, you will need to do it by hand.

  1. Export the file from MySQL to a CSV file.
  2. Export the create statements for the tables from MySQL
  3. Cry.
    3a. Disable foreign key checks in SQL server
  4. Tune the create statements in SQLserver until they work.
  5. Import the CSV files in to MySQL.
    5a. Enable foreign key checks in SQL server.

Also see these answers: migrate-from-mysql-to-sql-server-2008

如果对42000年这一错误有轻微的争议,对我来说,我指出,将MySQL全球模式推向si子,就可以解决:

set global sql_mode=ansi_quotes;

There are commercial solutions, but not free solutions. Depending on complexity of your database, rewriting SQL for target dialect can be trivial task - or a very hard one. Rewriting CREATE TABLE statements is never hard, it can be done by hand with no surprises. Procedures, functions and triggers are problematic.





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...