Use ODBC to connect to MSSQL or SYBASE databases in Ubuntu

Source: Internet
Author: User
Ubuntu has unixodbc. To connect to MSSQL or SYBASE, you need to install it first. To compile freetds, you need to install the packages unixodbc, unixodbc-bin, and unixodbc-dev. After installation, you can use tools such as ODBCConfig and DataManger. However, there are no MSSQL and SYBASE drivers. Install freetds. I tried to install freetds from the new version, but it seems that I cannot connect to MSSQL.

Ubuntu has unixodbc. To connect to MSSQL or SYBASE, you need to install it first. To compile freetds, you need to install the packages unixodbc, unixodbc-bin, and unixodbc-dev. After installation, you can use tools such as ODBCConfig and DataManger. However, there are no MSSQL and SYBASE drivers. Install freetds. I tried to install freetds from the new version, but it seems that I cannot connect to MSSQL. I don't know if the server is faulty. To be safe, download freetds source code and compile it yourself.

Download freetds source program freetds-stable.tgz to freetds website, decompress, to unzip the directory to run:
./Configure -- with-tdsver = 8.0 -- enable-msdblib -- enable-dbmfix -- with-gnu-ld -- enable-shared -- enable-static -- with-unixodbc =/usr
The option of this command is critical and you must pay attention to it.
Run after configure is complete
Sudo make
Sudo make install
After running, test:
Tsql-H host-ip-p port-U username-P password
1> the prompt indicates that the connection is successful, and the freetds installation is successful.

Run ODBCConfig and add a driver named TDS to the Drivers page:

After filling out the information, click the above check box to save it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.