Feedback Print

Linux

The automatic installation already comes with the MSSQL Server extension preconfigured, only needing to connect with the database. If you are using your own preconfigured environment, you will need to enable the MSSQL Server extension in PHP.

If you are using a Microsoft Azure server, see more configuration details click here.

PDO DBLIB

Configurando DBLIB Server no Linux

The automatic installation already comes with the PDO BDLIB preconfigured, only needing to install the FreeTDS and unixODBC so that you can do the connection.

Be certified that you already have the PHP extension for PDO DBLIB enabled.

You can install the extension with this command on terminal: sudo apt-get install php7.0-pdo-dblib

  • Access the shell(terminal) with root and install the packages below:

    • Distribution: Debian

      • sudo apt-get install unixODBC unixODBC-dev gcc nano wget make
    • Distribution: Ubuntu

      • sudo apt-get install unixodbc unixodbc-dev gcc nano wget make
    • Distribution: RHEL\CentOS

      • sudo yum install unixODBC unixODBC-devel gcc nano wget make
    • Distribution: Suse\OpenSuse

      • sudo zypper install unixODBC unixODBC-devel gcc nano wget make
  • Download FreeTDS:

    • wget http://cdn1.netmake.com.br/download/freetds-0.95.95.tar.gz
  • Descompact the FreeTDS:

    • tar -zxf freetds-0.95.95.tar.gz
  • Enter in the FreeTDS folder:

    • cd freetds-0.95.95
  • Run the command below to compile and install the FreeTDS :

    • sudo ./configure --with-tdsver=7.4 --with-unixodbc=/usr --disable-libiconv --disable-static --disable-threadsafe --enable-msdblib --disable-sspi --with-gnu-ld --enable-sybase-compat && make && make install
  • Edit the FreeTDS configuration file:

    • Distribution: Debian\Ubuntu
      • sudo nano /usr/local/etc/freetds.conf
    • Distribution: RHEL\CentOS
      • sudo nano /usr/local/freetds/freetds.conf
    • Distribution: Suse\OpenSuse
      • sudo nano /usr/local/freetds/freetds.conf
  • Sample settings:

[MSSQLServer] host = 192.168.254.171 instance = SQLEXPRESS port = 1433 tds version = 8.0

You need to use the name “MSSQLServer” ( it’s the DNS from FreeTDS ) in the option “Server/Host (Name or IP)” to do the connection with your SQLServer database.

Creating a Connection with ScriptCase

  • Access ScriptCase using the URL http://127.0.0.1:8090/scriptcase
  • After accessing ScriptCase, access or create a new project, click on the new connection icon or access “Database > New Connection”

Creating a new connection Creating a new connection

  • After that, you will see a page with all the database connections that you can create. Select a “MSSQL Server” connection

 Selecting a Linux database connection Selecting a Linux database connection

  • New connection : You will place the information of the connection to your database here:

 Connecting with Linux database Connecting with Linux database

  • Connection Name : Defines the name of your new connection.
  • DBMS Driver : Allows you to select the drivers: Native SRV PDO, Native SRV or ODBC.
  • Server/Host (Name or IP) : Insert the name or IP\INSTANCE of the server where the Linux database is located.
  • Database Name : Select the database.
  • Username : Inform the user to access the Linux database.
  • Password : Inform the password to access the Linux database.
  • Test Connection : Displays a message of the status of the connection if successful or not.

  • For more options on connecting, click on the Advanced tab:

 Advanced setup for the Linux database Advanced setup for the Linux database

  • Decimal Separator - Select the separator type, between a dot or a comma.
  • Unicode Converter - Select if there is going to be conversion of characters to Unicode.
  • Persistent Connection - Persistent Connection are connections that do not close when finishing a script.
  • Use the schema before table name - Allows the use of schemas before the name of the tables.

  • Filter : Accessing this tab, we can setup which tables will be listed on this connection:

Filtering the Linux database Filtering the Linux database

  • Show - Allows the display of the the filters on the tables, views, System Tables and procedures.
    • Tables - Allows to setup the display of Tables from your database.
    • Views - Allows to setup the display of Views from your database.
    • System Tables - Allows to setup the display of System Tables from your database.
    • Procedures - Allows to setup the display of Procedures from your database.
  • Searches - Allows to define which tables and Owner will be displayed.
    • Tables - Allows to define a prefix (prefix%) or name of the tables for display.
    • Owner - Allows to define the owner of the tables for listing.
    • Show - Allows to define what will be displayed or not from the table an owner’s setup.