title: PDOException: SQLSTATE 01002 Adaptive Server connection failed (severity 9)
body: <p>I have been following some answers over stackoverflow.</p>
  
  <p>My odbc. ini (located in /etc/odbc.ini)</p>
  
  <pre><code>[MSSQL]
  Description = MS SQL Server
  Driver = /usr/local/lib/libtdsodbc.so
  Server = host.of.the.server
  UID = myusername
  PWD = mypassword
  ReadOnly = No
  Port = 1433
  tds version = 8.0
  </code></pre>
  
  <p>My odbcinst.ini</p>
  
  <pre><code>[FreeTDS]
  Description = FreeTDS driver
  Driver = /usr/local/lib/libtdsodbc.so
  Setup=/usr/lib/odbc/libtdsS.so
  FileUsage = 1
  UsageCount = 1
  </code></pre>
  
  <p>Both of these files are empty at first. I just copied answer from the other threads.</p>
  
  <p>My freetds.conf</p>
  
  <pre><code># Global settings are overridden by those in a database
  # server specific section
  [global]
          # TDS protocol version
  ;       tds version = 8.0
  
          # Whether to write a TDSDUMP file for diagnostic purposes
          # (setting this to /tmp is insecure on a multi-user system)
  ;       dump file = /tmp/freetds.log
  ;       debug flags = 0xffff
  
          # Command and connection timeouts
  ;       timeout = 10
  ;       connect timeout = 10
  
          # If you get out-of-memory errors, it may mean that your client
          # is trying to allocate a huge buffer for a TEXT field.
          # Try setting 'text size' to a more reasonable limit
          text size = 64512
  
  # A typical Sybase server
  [egServer50]
          host = symachine.domain.com
          port = 5000
          tds version = 8.0
  
  # A typical Microsoft server
  [egServer70]
          host = ntmachine.domain.com
          port = 1433
          tds version = 7.0
  </code></pre>
  
  <p>I am using Laravel. Now, after I used the </p>
  
  <pre><code>php artisan migrate 
  </code></pre>
  
  <p>I got an error of:  PDOException:  SQLSTATE 01002 Adaptive Server connection failed (severity 9)</p>
  
  <p>Some of stackoverflow answers: possbile cause is TDS version.</p>
  
  <p>So I used <code>tsql -C</code> </p>
  
  <pre><code>    Version: freetds v0.91
           freetds.conf directory: /usr/local/etc
   MS db-lib source compatibility: yes
      Sybase binary compatibility: no
                    Thread safety: yes
                    iconv library: yes
                      TDS version: 5.0
                            iODBC: no
                         unixodbc: yes
            SSPI "trusted" logins: no
                         Kerberos: no
  </code></pre>
  
  <p>I am Using Ubuntu 16</p>