Skip to content

Conversation

@dmyers
Copy link
Contributor

@dmyers dmyers commented Dec 11, 2014

I've been playing with Laravel and SQL server the past few days.

Without this I get a PDOException with SQLSTATE[HY000] Unknown host machine name (severity 2) on my Mac connecting to SQL server.

I believe it's because dblib is Unix it is expecting a Unix style port separator : and the sqlsrv option is expecting , as it is the Windows style. The sqlsrv option works fine when I'm on Windows running Laravel.

Propel ORM has some dblib DSN examples that match too:
http://propelorm.org/Propel/cookbook/using-mssql-server.html#pdodblib

@GrahamCampbell
Copy link
Collaborator

Could you add a test for this?

@dmyers
Copy link
Contributor Author

dmyers commented Dec 11, 2014

@GrahamCampbell or @taylorotwell I updated the existing test which covers both the dblib and sqlsrv I think? I haven't done a whole lot of testing in Laravel just yet and ran into this today and thought it might help others.

@GrahamCampbell GrahamCampbell changed the title Fixed port separator in DSN when using dblib with PDO in sql server connector [4.2] Fixed port separator in DSN when using dblib with PDO in sql server connector Dec 13, 2014
taylorotwell added a commit that referenced this pull request Dec 15, 2014
[4.2] Fixed port separator in DSN when using dblib with PDO in sql server connector
@taylorotwell taylorotwell merged commit f706767 into laravel:4.2 Dec 15, 2014
@dmyers dmyers deleted the sqlsrv-dblib-port branch December 15, 2014 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants