Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

I've got: [PDOException] SQLSTATE[01002] Adaptive Server connection failed (severity 9) #19

Open
rubenlb opened this issue Nov 5, 2015 · 3 comments

Comments

@rubenlb
Copy link

rubenlb commented Nov 5, 2015

everything works.
I did:
tsql -H 192.168.0.4 -p 1433 -U username -P pword -D BDRrhh

locale is "LC_CTYPE=es_MX.UTF-8;LC_NUMERIC=es_BO.UTF-8;LC_TIME=es_BO.UTF-8;LC_COLLATE=es_MX.UTF-8;LC_MONETARY=es_BO.UTF-8;LC_MESSAGES=es_MX.UTF-8;LC_PAPER=es_BO.UTF-8;LC_NAME=es_BO.UTF-8;LC_ADDRESS=es_BO.UTF-8;LC_TELEPHONE=es_BO.UTF-8;LC_MEASUREMENT=es_BO.UTF-8;LC_IDENTIFICATION=es_BO.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Default database being set to BDRrhh

and i can do querys in php file with mssql_connect('192.168.0.4','username','pword);
but in symfony 2.3 i've got [PDOException] SQLSTATE[01002] Adaptive Server connection failed (severity 9)

please help me.....

@rogeriolino
Copy link

config.yml:

# Doctrine Configuration
doctrine:
    dbal:
        driver_class:   \Realestate\MssqlBundle\Driver\PDODblib\Driver
        host:     "%database_host%"
        user:     "%database_user%"
        password: "%database_password%"
        options:
            charset: UTF-8

In %database_host% specify the freetds entry name.

Ex:

freetds.conf:

[databasehost_tds]
        host = 192.168.0.4
        port = 1433
        tds version = 8.0
        client charset = UTF-8
        text size = 20971520

parameters.yml or config_dev.yml or config_prod.yml:

parameters:
    database_host: databasehost_tds

@umpirsky
Copy link

umpirsky commented Feb 9, 2016

Same for me, any updates?

@plewandowski
Copy link

plewandowski commented Oct 25, 2016

Hello,

I have fixed it by fixing DSN:

if (isset($params['port'])) {
     //$dsn .= 'port=' . $params['port'] . ';';
     $dsn = rtrim($dsn, ';') . ':' . $params['port'] . ';';
}

However I had no time to investigate problem in details yet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants