Linux 连接SQL Server数据库 并配置laravel进行连接
一、安装freetds
1、安装编译工具及驱动程序
yum install make apr* autoconf automake gcc gcc-c++ wget
2、安装unixODBC驱动程序
yum -y install unixODBC unixODBC-devel
3、安装freetds
cd /usr/local/src
wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-stable.tgz #下载,有时用wget命令下载不了
gunzip freetds-stable.tgz #解压
tar -xvf freetds-stable.tar
cd freetds-0.91
./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --with-unixodbc=/usr --enable-msdblib #配置
make #编译
make install #安装
4、配置freetds
cp /usr/local/freetds/etc/freetds.conf /usr/local/freetds/etc/freetds.confbak #备份原有文件
vi /usr/local/freetds/etc/freetds.conf #在最后位置修改编辑以下内容