Conectar SQLSERVER

199 views
Skip to first unread message

Lívio Rodrigues

unread,
Jul 13, 2017, 10:50:30 AM7/13/17
to Symfony Brasil
Ola devs!

Meu problema é conectar no sqlserver!

O que fiz ate agora foi:

1 - Verifiquei se o drive estava instalado: OK
$ Php -i | Grep PDO
PDO
PDO suporte => habilitado
PDO drivers => dblib, firebird, mysql, odbc, pgsql, sqlite
PDO Driver para FreeTDS / Sybase DB-lib => habilitado
PDO_Firebird
PDO Driver para Firebird => habilitado
PDO Driver para MySQL => habilitado Driver
PDO_ODBC
PDO para ODBC (unixODBC) =>
driver PDO habilitado para PostgreSQL =>
driver PDO habilitado para SQLite 3.x => habilitado

Tudo OK
________________________________________________
$tsql -C
Compile-time settings (established with the "configure" script)
Version: freetds v0.91
freetds.conf directory: /etc/freetds
MS db-lib source compatibility: no
Sybase binary compatibility: yes
Thread safety: yes
iconv library: yes
TDS version: 4.2
iODBC: no
unixodbc: yes
SSPI "trusted" logins: no
Kerberos: yes

_____________________________________________________

Meu arquivo /etc/freetds/freetds.conf
[sqlserver]
Driver = FreeTDS
host = 192.168.98.199
port = 1433
tds version = 8.0

_________________________________________
QUANDO RODO ESTE COMANDO ELE CONECTA NORMAL E RODA A SQL QUE EU COLOCAR NA SHELL

$isql -v sqlserver syscpd '(sw):$ajr:(*)'
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>

__________________________________________________________
QUANDO RODO ESTE NA SHELL DO SYMFONY

$bin/console doctrine:query:sql "select * from [pm01estoque].[dbo].[cadcop00]" --connection=sqlserver

GERA ESTE ERRO

[PDOException]
SQLSTATE[01002] Adaptive Server connection failed (severity 9)


ALGUEM PODE ME AJUDAR EM ACHAR UMA SOLUÇÃO PRA ISSO????

Julius Sanctus

unread,
Jul 13, 2017, 3:47:36 PM7/13/17
to symfo...@googlegroups.com
Olá Lívio,

tenho usado este Bundle (https://github.com/realestateconz/MssqlBundle) para conexão com o SqlServer e tem funcionando certinho.
Abraços,


--
You received this message because you are subscribed to the Google Groups "Symfony Brasil" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony-pt+unsubscribe@googlegroups.com.
To post to this group, send email to symfo...@googlegroups.com.
Visit this group at https://groups.google.com/group/symfony-pt.
For more options, visit https://groups.google.com/d/optout.



--

"Nada poderá nos separar do amor de Deus"
Romanos 8:39
Reply all
Reply to author
Forward
0 new messages