Install Freetds v1- Centos 6.10 - Connect to MSSQL 2016

Issues related to applications and software problems
Post Reply
Technet
Posts: 9
Joined: 2014/11/24 13:23:29

Install Freetds v1- Centos 6.10 - Connect to MSSQL 2016

Post by Technet » 2019/12/04 08:50:17

I have to connect to a MSSQL database server recently upgraded to 2016 version.

I've read that i need freetds version 1.0 at minimum.(https://www.freetds.org/userguide/choos ... otocol.htm)
On the epel repository of Centos 6.10 i can find only freetds 0.91.

How i can install FreeTDS version 1 on Centos 6.10 ?

User avatar
TrevorH
Forum Moderator
Posts: 29653
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Install Freetds v1- Centos 6.10 - Connect to MSSQL 2016

Post by TrevorH » 2019/12/04 10:01:55

Maybe time to start thinking about moving to a newer CentOS. CentOS 6 has less than one year of life left so you should be planning to migrate anyway. CentOS 7 has freetds 1.1.20 in EPEL, so does CentOS 8.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Technet
Posts: 9
Joined: 2014/11/24 13:23:29

Re: Install Freetds v1- Centos 6.10 - Connect to MSSQL 2016

Post by Technet » 2019/12/04 10:50:50

Move to Centos 7 or 8 means re-create from zero the server. At this time is not possible and not useful, in early 2021 the server will be replaced by external cloud service.
There is a way to install freetds V1 on centos 6.10 ?

User avatar
remirepo
Posts: 402
Joined: 2014/09/21 09:07:12
Location: France
Contact:

Re: Install Freetds v1- Centos 6.10 - Connect to MSSQL 2016

Post by remirepo » 2019/12/04 11:08:04

Some time ago, I wrote https://blog.remirepo.net/post/2016/09/ ... r-from-PHP

And didn't encounter any issue to connect (was a 2014 server) using freetds 0.95 at that time

So worth to be tried

Else, you will have to build it from sources...
And indeed, EL-6 is really old and not a good choice for "modern" stuff, like this one.
Remi's Repository - Forum - Blog

Technet
Posts: 9
Joined: 2014/11/24 13:23:29

Re: Install Freetds v1- Centos 6.10 - Connect to MSSQL 2016

Post by Technet » 2019/12/04 12:53:51

I've read your blog article. I'm using the option 1 of your article.
In the epel repository of centos 6 there is only freetds 0.91, not 0.95
The mssql version i have to connect with is 2016.

Technet
Posts: 9
Joined: 2014/11/24 13:23:29

Re: Install Freetds v1- Centos 6.10 - Connect to MSSQL 2016

Post by Technet » 2019/12/04 14:50:42

Ok. Forced a lower version of Mssql protocol and now i can connect to the database.

Using

Code: Select all

echo "+ Connection\n";
$pdo = new PDO("odbc:MSSQLServer", "user", "pass");
echo "+ Query\n";
$query = $pdo->query("SELECT @@version");
...
I get the answer:

Code: Select all

Microsoft SQL Server 2016 (SP2-GDR) (KB4505220) - 13.0.5101.9 (X64) Jun 15 2019 23:15:58 Copyright (c) Microsoft Corporation Express Edition (64-bit) on Windows Server 2016 Standard 10.0 (Build 14393: ) (Hypervisor)
but i'm unable to do a simple select query:

Code: Select all

$query = $pdo->query("SELECT * FROM table")
i get nothing.. but the table is filled with many row.

How can i do a query ?

Post Reply

Return to “CentOS 6 - Software Support”