SSMS 17 Connection to MariaDB Error

Paul Speirs 11 Reputation points
2022-08-12T08:00:09.267+00:00

Hi All,
I've been struggling to connect a linked server connection to a MariaDB instance on my local network. Any assistance in the right direction would be awesome.

I've set up an ODBC System DSN called "HA_Maria_DB" which Tests fine.

I then created a linked server with the following properties:

General Tab

=================

Provider: SQL Server Native Client 11.0 or Microsoft OLE DB Provider for SQL Server
Product Name: HA_Maria_DB
Data Source: HA_Maria_DB

Security Tab

=================

Be made using this security context, and set the correct username/password that was configured in the System DSN

Server Options

=================

RPC and RPC Out were both set to true.

The error I'm receiving is:

The test connection to the linked server failed.

------------------------------

ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Named Pipes Provider: Could not open a connection to SQL Server [67].
OLE DB provider "SQLNCLI11" for linked server "HA_MARIA_DB" returned message "Login timeout expired".
OLE DB provider "SQLNCLI11" for linked server "HA_MARIA_DB" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.". (Microsoft SQL Server, Error: 67)

SQL Server | Other
{count} vote

3 answers

Sort by: Most helpful
  1. Erland Sommarskog 121.9K Reputation points MVP Volunteer Moderator
    2022-08-12T08:11:56.49+00:00

    I have no experience of connecting to MariaDB, but what I can say is that you are on the wrong track entirely.

    To set up a linked server, you need to have an OLE DB provider or an ODBC driver installed for the data source in question. You have chosen SQLNCLI11, which is an OLE DB provider to connect to SQL Server, and only SQL Server.

    This is not any different from if you are building an application, you need to have a client API installed. What is specific when it comes to set up a linked server is that they always use OLE DB. But this is no major obstacle, as you can select the MSDASQL provider, which is a generic provider that talks to an ODBC driver. (Well, at least in theory. Linked servers often mean hassle, and it does not get easier when you add one more layer. When things work, they work. When they do not, the error message you get are often obscure.)

    1 person found this answer helpful.
    0 comments No comments

  2. Seeya Xi-MSFT 16,586 Reputation points
    2022-08-17T07:08:05.64+00:00

    Hi @Paul Speirs ,

    Welcome to Microsofrt Q&A. I find a series of articles to show you, you can start here: https://www.cdata.com/kb/tech/mariadb-odbc-linked-server.rst
    Hope this would give you some help.

    Best regards,
    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

  3. Paul Speirs 11 Reputation points
    2022-08-17T22:51:18.88+00:00

    Hi @Seeya Xi-MSFT

    Many thanks for the info, I'll go through it today if I get the time.

    Regards,
    Paul

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.