SQL Server synchronizes MySQL with linked Server

Source: Internet
Author: User
Tags sql 2014 sql server query mysql login

--Test environment SQL 2014

In the MySQL environment:

Use test; Create Table Demo (ID int,name varchar (50))

In Control Panel-Administrative Tools-Data source (ODBC)-System DSN

--Join


--Next (complete)


Next (OK)

Normal display configuration (Mysql_link), remember name

Operation in SQL Server Query Analyzer or SSMS interface


Method 1: Take SSMs as an example

--Open Enterprise Manager-server Object-Link server-right (new)


Next, login information

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center "/>


Method 2: Or create a linked server with a statement in Query Analyzer

Use [master]goexec master.dbo.sp_addlinkedserver @server = N ' mysql ', @srvproduct =n ' MySQL ', @provider =n ' msdasql ', @ Datasrc=n ' Mysql_link ', @catalog =n ' test ' EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname =n ' MySql ', @useself =n ' False ', @locallogin =null, @rmtuser =n ' root ', @rmtpassword = ' ######## '--mysql login account (root) password


In SQL Server Query Analyzer test:

--Test Insert OPENQUERY (MySQL, ' SELECT * from Test. Demo ') (Id,name) VALUES (1, ' Roy ')--query SELECT * from   OPENQUERY (MySQL, ' select * from Test. Demo ') as a/*idname1roy*/

Original post: Click to open link

SQL Server synchronizes MySQL with linked Server

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.