To achieve direct access to the table data in the mysql database through the sqlsever database.

To achieve direct access to the table data in the mysql database through the sqlsever database.

The first step is to download and install the download ODBC driver of the corresponding version.

download link:
Insert picture description here

Find the appropriate version of your own operating system, download and install it. The example is the WINDOWS64-bit version.
Two, configure ODBC data source
Insert picture description here

Run with administrator rights.
Insert picture description here
Insert picture description here

3. Configure database link
Open sqlserver management studio, select [server object], right-click [link server], select [new linked server],
enter the custom server link name in the [General] tab, and select [other data sources]
[Provider] item, select [Microsoft OLE DB Provider For ODBC Drivers], don’t make a mistake,
enter product name (custom), data source name (name XXX defined in the previous step)
[Security] tab, select [use this Security context to establish a connection], enter the remote login user name and password
OK!
If no error is reported, refresh the [Link Server] node, right-click the newly added link name, and select [Test Link], there is no problem.
Insert picture description here
Insert picture description here
Insert picture description here

Fourth, query
OPENQUERY mode
SELECT * FROM OPENQUERY (dblink name,'select * from t_table');

Guess you like

Origin blog.csdn.net/weixin_45605697/article/details/109304666