Recently, I encountered the problem of "how to connect SQL to remote MySQL", and now the problem is finally solved. I posted the method: (my operating system is Win7, and the database is SQL2005 .)
1. Install the mysql odbc driver on the SQL SERVER;
Http://dev.mysql.com/downloads/mirror.php? Id = 376346 ()
2. After installation, choose "Management Tools"> "ODBC Data Source"> "system DSN"> "add"> "mysql odbc 3.51 DRIVER"> "complete ".
MYSQL connection parameters are displayed.
Data Source Name: Data Source Name
Decription: description.
Server: IP address of the MYSQL Server
Port: MYSQL Port. The default value is 3306. You can change the value.
User: The account authorized by the connection account on mysql, and the corresponding permissions are granted)
Password: Password
Database: select the connected Database
After filling out the information, click test. The prompt box will pop out.
After successful:
3. Open the SQL database and find the link to the server. you can create a linked server, so I will send the parameter ., other options are not required. OK.
Note: select "Microsoft ole db Provider for ODBC Drivers" for the access interface ".
Data source: select the created ODBC interface.
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 ', '2016 ')
Original article title: how to connect SQL to remote MySQL 1)
Link: http://www.cnblogs.com/guolebin7/archive/2010/08/21/1805162.html
Edit recommendations]