[MDEV-5144] Using connect engine to connect to SQL Server 2008 R2 from mysql on linux Created: 2013-10-15 Updated: 2013-11-01 Resolved: 2013-11-01 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Eric Hernandez | Assignee: | Alexander Barkov |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | connect-engine | ||
| Environment: |
Debian 7.1 and CentOS 6.4 |
||
| Description |
|
I am trying to connect to SQL Server 2008 R2 using the connect engine and running mysql from linux I have tried on two different platforms to make this work ############ relevant packages installed:
Proof that odbc is working from linux to Sql server via the command line. Note that credentials have to be supplied. I have sanitized the username and password.
Attempt to create connect table from within maria
################################## CentOS release 6.4 (Final)
Ok on CentOS I first tried to setup Integrated Authentication from Linux to Microsoft SQL Server and I was successful. Here is the proof that it works.
Now keep in mind that in prior test on debian i used freetds as my SQL Server driver. Here is the result from MySQL Client
|
| Comments |
| Comment by Alexander Barkov [ 2013-10-23 ] |
|
Can you please specify UID and PWD in the connection string on Debian, like this: CREATE TABLE connect_table ( Note, ConnectSE supports so called discovery, so in many cases it's ok not to specify table structure, CREATE TABLE connect_table ENGINE=CONNECT CONNECTION='DSN=MSSQLTestServer;UID=sa;PWD=passwd' table_type=odbc; |
| Comment by Alexander Barkov [ 2013-10-23 ] |
|
I will check with the native MS SQL driver for Linux and report back separately. |
| Comment by Alexander Barkov [ 2013-10-23 ] |
|
Btw, did you reinstall unixODBC to the version 2.3.0, which the MS driver requires ? |
| Comment by Eric Hernandez [ 2013-10-23 ] |
|
Yes i did custom compile unixODBC 2.3.0 as per instruction on the microsoft site and I was successfully able to do integrated authentication from the command line (on centos). I will try again with the UID and PWD soon. |
| Comment by Eric Hernandez [ 2013-10-23 ] |
|
So that worked!!! I guess all i was missing was the credentials in the table definition. |
| Comment by Alexander Barkov [ 2013-10-23 ] |
|
Eric, excellent. Good to know. Olivier, please consider documenting this detail. |
| Comment by Alexander Barkov [ 2013-10-23 ] |
|
Eric, can you please clarify why you're trying to use the Microsoft native driver on the CentOS box, Is there anything in the MS driver that FreeTDS does not support, or are you trying it |
| Comment by Olivier Bertrand [ 2013-10-24 ] |
|
I am mostly familiar with Windows ODBC (the original product) but unixODBC has probably the same features: ODBC connections can be specified in two ways: [MSSQLTestServer] [MyMSSQL] Doing so you should be able to create your table just saying: CREATE TABLE connect_table ENGINE=CONNECT table_type=odbc CONNECTION='DSN=MyMSSQL'; The equivalent works fine on Windows, I did not yet test it on Linux (I am using ubuntu) Note that the parameters required for a connection depend on the ODBC connector you use. They cannot be described in the CONNECT documentation and you should refer to the used connector documentation to know what they are. |
| Comment by Eric Hernandez [ 2013-10-24 ] |
|
Alex, |
| Comment by Alexander Barkov [ 2013-10-24 ] |
|
Olivier, It would be nice to have a new manual section with tips how to use various ODBC drivers. |
| Comment by Alexander Barkov [ 2013-10-24 ] |
|
Eric, Have you solved all the problems you had? Can we close the issue? Thanks for fast feedback! |
| Comment by Eric Hernandez [ 2013-10-25 ] |
|
Yes this problem is solved now. Thank you for the help. However I am probably going to open up some other tickets because I am On Wed, Oct 23, 2013 at 11:31 PM, Alexander Barkov (JIRA) < – |
| Comment by Olivier Bertrand [ 2013-10-25 ] |
|
To access a table via ODBC, CONNECT rephrases the original query and send it to the Because both are using SQL, this is generally not a problem. However, because some select upper(`first name`), `Salary` * 0.95 from `Employee`; could be rephrased as: SELECT "first name", "Salary" FROM "Employee" The scalar function and expression will be locally calculated by MariaDB. See below Where clause not being passed to the data source: set optimizer_switch='engine_condition_pushdown=on'; Or starting mysqld with this parameter set to ON, for instance: mysqld --console --engine_condition_pushdown=on Note 1: specifying -console is important to have some error messages from CONNECT printed Note 2: since MariaDB 10.0.4, the CONDITION_PUSHDOWN argument is no more accepted. 2 - The technique used above (getting only column values) obviously cannot be used here because select Count Random crashes New version |
| Comment by Alexander Barkov [ 2013-11-01 ] |
|
Eric, I'm closing this ticket. |