您现在的位置是:MSSQL - 技术吧
  • php连接mssql中文乱码问题

    修改php.ini

    mssql.charset = "UTF-8"

    yuli0927 2017年12月25日 标签: PHP MSSQL分类: MSSQL

  • Linux系统连接MSSQL

    安装unixODBC、freetds


    cd ~
    yum install unixODBC
    wget http://mirrors.xmu.edu.cn/ubuntu/archive/pool/main/f/freetds/freetds_0.82.orig.tar.gz
    tar -zxvf freetds_0.82.orig.tar.gz
    cd freetds-0.82
    ./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --enable-msdblib --enable-dbmfix
    make && make install
    
    echo "/usr/local/freetds/lib" >> /etc/ld.so.conf
    ldconfig
    
    /usr/local/freetds/bin/tsql -H 10.206.3.9 -p 1433 -U admin -P 123456
    连接成功后,显示
    locale is "en_US.UTF-8"
    locale charset is "UTF-8"
    1>
    点击查看原图



    /php-5.4.41/ext/mssql/mssql
    /usr/local/webserver/php/bin/phpize
    ./configure –with-php-config=/usr/local/webserver/php/bin/php-config –with-mssql=/usr/local/freetds 
    make 
    make install 
    
    find / -name mssql.so
    /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/mssql.so
    
    vi /usr/local/php/etc/php.ini
    extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/mssql.so
    
    配置freetds.conf



    vi /usr/local/freetds/etc/freetds.conf
    #Chinese
    client charset = GBK
    
    # A typical Microsoft server
    [egServer]
            host = 10.206.3.9
            port = 1433
            tds version = 8.0


    yuli0927 2016年12月01日 标签: Linux MSSQL分类: MSSQL