NoiZy
(Christian Neusz)
September 29, 2009, 1:30pm
1
Hi,
I’m trying now for hours to get my yii app to work with a MS sql db, I read any articel in the web that is providet by google, but I don’t get it!!! ;(
My Yii connection string is:
‘db’=>array(
'connectionString'=>'mssql:host=SERVER\SQLEXPRESS;dbname=dbname', 'username'=>'sa', 'password'=>'sql_server_pass', 'charset'=>'utf8'
),
And I get the exception:
SQLSTATE[01002] Unable to connect: SQL Server is unavailable or does not exist. Access denied. (severity 9)
But I use the same login data in Visual Studio (Also on my local pc, not on SERVER) and there everything works fine.
I have no ideas, maybe Apache or PHP blocks the connection, I don’t know ;(
Any ideas Guys?
PS:
My System is Windows (Both, server and my client) and on my client I have installed "wampserver 2.0h"
Best regards
Chris
NoiZy
(Christian Neusz)
September 29, 2009, 1:36pm
2
Unbelievble, my last try was to copy a dll in the apache/bin folder and know I got a different exception, mybe better???
It says:
SQLSTATE[HY000]: General error: 10007 ‘NAMES’ wird nicht als SET-Option erkannt. [10007] (severity 5) []
On english:
General error: 10007 ‘NAMES’ is not known as SET-option. [10007] (severity 5) []
Hi,
I’m trying now for hours to get my yii app to work with a MS sql db, I read any articel in the web that is providet by google, but I don’t get it!!! ;(
My Yii connection string is:
‘db’=>array(
'connectionString'=>'mssql:host=SERVER\SQLEXPRESS;dbname=dbname', 'username'=>'sa', 'password'=>'sql_server_pass', 'charset'=>'utf8'
),
And I get the exception:
SQLSTATE[01002] Unable to connect: SQL Server is unavailable or does not exist. Access denied. (severity 9)
But I use the same login data in Visual Studio (Also on my local pc, not on SERVER) and there everything works fine.
I have no ideas, maybe Apache or PHP blocks the connection, I don’t know ;(
Any ideas Guys?
PS:
My System is Windows (Both, server and my client) and on my client I have installed "wampserver 2.0h"
Best regards
Chris
jjmf
(Joao)
November 10, 2009, 7:33pm
4
NoiZy:
No one can help me ;(
I need it for my job.
try commenting out the line “‘charset’=>‘utf8’”.
Dave
(Deventer)
November 11, 2009, 11:31am
5
with mssql you need to provide the charset within the dsn.
sidney
(Blackjenova)
November 12, 2009, 4:24am
6
I always use this in my config (to connect to MSSQL)
'db'=>array(
'class'=>'CDbConnection',
'connectionString' => 'mssql:host=192.168.1.13;dbname=MyDB', 'username'=>'sa', 'password'=>'mypwd'
)
host is my computer’s IP number