Monday, May 16, 2016

MySQL Linked Server from SQL Server 2014

MySQL Linked Server from SQL Server 2014

It might work from other SQL Server versions...

Install MySQL ODBC connector

  • Download and install latest x64 MySQL ODBC connector; version 5.3.6 at the moment of this post.
  • Create an x64 ODBC System DSN; suppose we named it MySQLDS

Create the Linked Server

  • Add a Linked Server
    • Name: at your will, suppose MySQLLS
    • Provider: Microsoft OLEDB Provider for ODBC Drivers
    • Product Name: MySQL
    • Data Source: MySQLDS
    • Provider String:ODBC;DSN=MySQLDS
    • Location: (empty)
    • Catalog:<name of desired catalog>
  • On Security tab:
    • Check Be made using this security context:
      • root (not really very secure)
      • <password>

Change Provider Options (Linked Servers->Providesr->MSDASQL)

  • Check Level zero only; this will allow sentences like SELECT * FROM MySQLLS...Table
IyBNeVNRTCBMaW5rZWQgU2VydmVyIGZyb20gU1FMIFNlcnZlciAyMDE0DQoNCkl0IG1pZ2h0IHdvcmsgZnJvbSBvdGhlciBTUUwgU2VydmVyIHZlcnNpb25zLi4uDQoNCiMjIEluc3RhbGwgTXlTUUwgT0RCQyBjb25uZWN0b3INCg0KKiBEb3dubG9hZCBhbmQgaW5zdGFsbCBsYXRlc3QgeDY0IE15U1FMIE9EQkMgY29ubmVjdG9yOyB2ZXJzaW9uIDUuMy42IGF0IHRoZSBtb21lbnQgb2YgdGhpcyBwb3N0Lg0KKiBDcmVhdGUgYW4geDY0IE9EQkMgU3lzdGVtIERTTjsgc3VwcG9zZSB3ZSBuYW1lZCBpdCBgTXlTUUxEU2ANCg0KIyMgQ3JlYXRlIHRoZSBMaW5rZWQgU2VydmVyDQoNCiogQWRkIGEgTGlua2VkIFNlcnZlcg0KCSogTmFtZTogYXQgeW91ciB3aWxsLCBzdXBwb3NlIGBNeVNRTExTYA0KCSogUHJvdmlkZXI6IGBNaWNyb3NvZnQgT0xFREIgUHJvdmlkZXIgZm9yIE9EQkMgRHJpdmVyc2ANCgkqIFByb2R1Y3QgTmFtZTogTXlTUUwNCgkqIERhdGEgU291cmNlOiB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