SQLSERVER数据导入到MYSQL
SQLSERVER数据导入到MYSQL http://hi.baidu.com/luck001221/item/cb4462299f9ea79ab73263d2?qq-pf-to=pcqq.group 1、去mysql的官方下载一个odbc的驱动,因为MSsql一直没有集成mysql的驱动,这个玩意需要单独下载,并安装的。 http://dev.mysql.com/downloads
SQLSERVER数据导入到MYSQL
http://hi.baidu.com/luck001221/item/cb4462299f9ea79ab73263d2?qq-pf-to=pcqq.group
1、去mysql的官方下载一个odbc的驱动,因为MSsql一直没有集成mysql的驱动,这个玩意需要单独下载,并安装的。
http://dev.mysql.com/downloads/connector/odbc/5.1.html
我下载的是windows解压缩的包Without installer (unzip in C:\),没有选择安装的。绿色版比安装版本要好。点击install的一个bat文件。
2、如果安装成功,在ODBC数据源驱动里面有个选项,如下图:
3、点击上图的用户dsn,添加一个mysql的连接,前提是你有一个mysql的数据库。
双击之后出现下面的提示框:
啊,哈,成功了一半了。
4、如果是SQL server2000用DTS的话,就可以直接用了。关键步骤在下面
下面这个界面很熟悉了:
ok导入完成了。
当然也可以使用文件dsn,把连接串存成一个文件,然后导入的时候选择文件dsn,只要找到连接串的路径就可以了,不在赘述。。
5、如果你用的是SQL2005的ssis的话,有点恶心。在这里我在强调一下:
我十分讨厌sql2005里面的DTS。希望微软的人能看到。
这里面的dsn要手动写的,没有办法从odbc里面直接读取出来,这个功能很实用,不会让人产生很多的误解。但是在2k5里面却没有,非常费解,微软的家伙是干啥吃的。
别以为你已经成功了,点下一步,在点下一步,等死吧。
我操,只能选择-编写查询以指定要传输的数据。吐血了。。有200多个表啊。这tmd咋搞?
经过测试,文件dsn和系统dsn都没有选择所有的表。而如果选择文件dsn用连接字符串的方式报这个错误:
我十分讨厌SQL server2005的DTS功能,设计微软SQL Server 2005的工程师是个白痴。
我决定用2K了。
我有测试了一下2008,嗯。2008有这个功能,下图:
SQL Server 迁移数据到MySQL
http://www.cnblogs.com/gaizai/p/3237907.html
一、背景
由于项目开始时候使用的数据库是SQL Server,后来把存储的数据库调整为MySQL,所以需要把SQL Server的数据转移到MySQL;由于涉及的表比较多,所以想在MySQL中生成对应表并导入数据;
上网找了些资料,如:将ACCESS和MSSQL导入MYSQL中、MySQL Migration 实现 MSSQL 到 MySQL数据迁移,虽然不知道里面的做法是否可以成功转移,但是里面的过程比较复杂,没有去尝试,后来自己找到了方法,最重要就是简单和准确(暂时没发现明显的BUG),这里分享给大家。
二、转移数据
我使用了MySQL的Client的工具SQLyog,这个工具的安装很简单。安装完成之后点击需要导入的目标数据库,点击右键【Import】->【Import Extenal Data】;
(Figure1:Import)
选择【Start a new job】,点击【下一步】;
(Figure2:Start a new job)
下面就是DSN的设置界面,如果你的下来列表中没有需要导出SQL Server数据库的DSN,那么需要通过【Create a New DSN】来创建一个新的DSN连接到SQL Sever;
(Figure3:Create a New DSN)
(Figure4:创建新数据源)
(Figure5:选择数据源类型)
把上面的设置保存为一个local.dsn文件;
(Figure6:选择数据源保存路径)
(Figure7:选择SQL Server服务器)
(Figure8:设置SQL Server帐号和密码)
(Figure9:选择SQL Server数据库)
(Figure10:测试数据源)
(Figure11:测试成功)
选中【File DSN】,在浏览中选择我们刚刚创建好的DSN,接着填写登录到SQL Server的帐号和密码;
(Figure12:选择DSN)
下一步,选择目标MySQL服务器,填写IP地址和帐号密码,并且需要选择目标数据库;
(Figure13:设置MySQL帐号和密码目标数据库)
这一步类似SQL Server的导入导出功能,这里可以拷贝一个表或者使用SQL脚本过滤数据;
(Figure14:表拷贝)
上面的全部过程就是为创建SQL Server与MySQL的一个管道,接下来就是最为重要的设置SQL Server表与MySQL表之间的对应关系了;里面包括了SQL Server表字段与MySQL表字段之间的对应关系【Map】,高级选项【Advanced】,过滤【WHERE】。
(Figure15:选择表对应关系)
下图Figure16,数据源【Source】,描述【Destination】,特别注意这里数据类型【Type】,这里的意思是转换目标的数据类型,但是不需要跟目标表的一样,因为这里是做为一个临时存储的数据类型,类似FindOn在SQL Server中是datetime,这里转换为MySQL的timestamp,其实MySQL目标表的数据类型是datetime,这样的设置也是可以转换成功的。
(Figure16:表字段转换)
(Figure17:高级选项)
(Figure18:Error)
(Figure19:Log)
(Figure20:执行信息)
(Figure21:执行结果)
(Figure22:原始SQL Server的数据列表)
(Figure23:转移到MySQL的数据列表)
对比下Figure20与Figure21,发现我们数据已经全部转移成功了;

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

MySQL query performance can be optimized by building indexes that reduce lookup time from linear complexity to logarithmic complexity. Use PreparedStatements to prevent SQL injection and improve query performance. Limit query results and reduce the amount of data processed by the server. Optimize join queries, including using appropriate join types, creating indexes, and considering using subqueries. Analyze queries to identify bottlenecks; use caching to reduce database load; optimize PHP code to minimize overhead.

Backing up and restoring a MySQL database in PHP can be achieved by following these steps: Back up the database: Use the mysqldump command to dump the database into a SQL file. Restore database: Use the mysql command to restore the database from SQL files.

How to insert data into MySQL table? Connect to the database: Use mysqli to establish a connection to the database. Prepare the SQL query: Write an INSERT statement to specify the columns and values to be inserted. Execute query: Use the query() method to execute the insertion query. If successful, a confirmation message will be output.

One of the major changes introduced in MySQL 8.4 (the latest LTS release as of 2024) is that the "MySQL Native Password" plugin is no longer enabled by default. Further, MySQL 9.0 removes this plugin completely. This change affects PHP and other app

To use MySQL stored procedures in PHP: Use PDO or the MySQLi extension to connect to a MySQL database. Prepare the statement to call the stored procedure. Execute the stored procedure. Process the result set (if the stored procedure returns results). Close the database connection.

Creating a MySQL table using PHP requires the following steps: Connect to the database. Create the database if it does not exist. Select a database. Create table. Execute the query. Close the connection.

70B model, 1000 tokens can be generated in seconds, which translates into nearly 4000 characters! The researchers fine-tuned Llama3 and introduced an acceleration algorithm. Compared with the native version, the speed is 13 times faster! Not only is it fast, its performance on code rewriting tasks even surpasses GPT-4o. This achievement comes from anysphere, the team behind the popular AI programming artifact Cursor, and OpenAI also participated in the investment. You must know that on Groq, a well-known fast inference acceleration framework, the inference speed of 70BLlama3 is only more than 300 tokens per second. With the speed of Cursor, it can be said that it achieves near-instant complete code file editing. Some people call it a good guy, if you put Curs

Last week, amid the internal wave of resignations and external criticism, OpenAI was plagued by internal and external troubles: - The infringement of the widow sister sparked global heated discussions - Employees signing "overlord clauses" were exposed one after another - Netizens listed Ultraman's "seven deadly sins" Rumors refuting: According to leaked information and documents obtained by Vox, OpenAI’s senior leadership, including Altman, was well aware of these equity recovery provisions and signed off on them. In addition, there is a serious and urgent issue facing OpenAI - AI safety. The recent departures of five security-related employees, including two of its most prominent employees, and the dissolution of the "Super Alignment" team have once again put OpenAI's security issues in the spotlight. Fortune magazine reported that OpenA
