How to connect mssql from linux using FreeTDS

How to connect mssql from linux using FreeTDS

Hi everyone, to day i show you how to connect Microsoft Sql Server from linux At first, i connect to my server get system overview We need to install epel (Extra Packages for Enterprise Linux) let check you see, i have a repo with name “Extra Packages for Enterprise Linux” here let update system We will install freeTDS and install unixODBC We need to config mssql database server name in /etc/freetds.conf file I will config some parameters includes host, port and tds version press Ctrl + O and Enter to save this file and Ctrl + X to exit test connection with tsql can’t not connect i will check with telnet We need to config firewall of database server to allow port 1433 of mssql service and we need to config static port of mssql service good, we are connected to mssql next, i show you how to connect mssql in php code we need to create template driver which for import to etc/odbcinst.ini file and register template file to odbcinst.ini create template file which for import to /etc/odbc.ini register domain server name to odbc.ini we need to install php-odbc extention restart httpd service here, i already have index.php file and let see result in browser oh, unable to connect to mssql we need to some configs in SeLinux yes, connectd Thank you for your watching

5 thoughts on “How to connect mssql from linux using FreeTDS

  1. Hi Phuong, does FREETds work on a local Windows apache installs using PHP 7.0.33? I have been trying to find dll drivers for pdo_dblib. What I am reading it appears that they only work on non-windows servers. I cannot use sqlsrv extension due to legacy code limitations.. i cant change my queries to use sqlsrv. Any advice would be appreciated!

Leave a Reply

Your email address will not be published. Required fields are marked *