Detailed explanation of how SQL Server links a remote MySQL database

Source: Internet
Author: User
Tags insert odbc sql mysql mysql database mysql odbc driver

Recently encountered the "SQL How to link remote MySQL" Problem, now the problem is finally resolved, special methods posted: (I used the operating system is Win7, the database is SQL2005.) )

1, install the MySQL ODBC driver on the SQL Server server;

http://dev.mysql.com/downloads/mirror.php?id=376346 (Download address)

 2, after installation, in the management tool-ODBC data Source-System dsn-Add-Choose MYSQL ODBC 3.51 driver-complete

Will jump out of MySQL connection parameters.

Data Source Name: DataSource names

Decription: Description, casual writing

IP of the Server:mysql server

Port:mysql port, the default is 3306. can be changed.

User: Connect account (authorized on MySQL account, give appropriate permission at the same time)

Password: Password

Database: Selecting linked Databases

After filling, click Test. If successful, it will jump out of the box as shown.

After success:

3, Open the SQL database and find the linked server. Create a linked server, everyone will, so I send the parameters. As shown, the rest of the general options are not required. Ok.

Here, note that the provider will choose Microsoft OLE DB Provider for ODBC Drivers.

Data Source: Select the ODBC interface that was previously created.

4. Test:

(Query statement)

SELECT * from OPENQUERY (MYSQL, select * from table)

(INSERT statement)

Insert openquery (MYSQL, select * from table) (Id,name,password) VALUES (8, "Zidane", "99999")




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.