First, ensure that the Win7 can telnet to the MySQL port, firewall settings can refer to http://www.cnblogs.com/ShanFish/p/6519950.html
Second, configure the System DSN
1. Install MySQL ODBC driver on Win7
2, management tools->ODBC data source, System dsn-> Add, select [MySQL ODBC 5.3 Unicode driver]-> Complete, configure connection information
Third, create a linked server
General provider: [Microsoft OLE DB Provider for ODBC Drivers]; Data Source: 2nd Step Add the System DSN name
"Security" choose to create a connection using this security context, fill in the MySQL database login name and password
--query in SSMsSELECT * from OPENQUERY(DBLINKVM,'SELECT @ @port, @ @version')SELECT * from OPENQUERY(DBLINKVM,'select * from Sakila.actor limit')SELECT * from OPENQUERY(DBLINKVM,'Show CREATE TABLE Complaintdb.area_info')
MySQL view table, field description
#MySQL查看表, field description MySQL> SELECTtable_name,column_name,column_type,is_nullable,column_key,column_comment from(SelectTable_name,column_name,ordinal_position,column_type,is_nullable,column_key,column_comment fromInformation_schema.columnswhereTable_schema='Complaintdb'UNION AllSELECTTABLE_NAME,"',"',"',"',"', table_comment fromInformation_schema.tableswhereTable_schema='Complaintdb') AORDER byTABLE_NAME, (ordinal_position+0);
Win7 SQL Server access to MySQL on a virtual machine