• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to connect to Microsoft Azure SQL.


I've been trying to connect to Microsoft Azure SQL but I'm not having any success.

$db['default']['hostname'] = 'tcp:serverName.database.windows.net';
$db['default']['username'] = '[email protected]';
$db['default']['password'] = 'password';
$db['default']['database'] = 'dbName';
$db['default']['dbdriver'] = 'sqlsrv';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

I'm getting a generic error, Unable to connect to your database server using the provided settings.

I have downloaded the PHP SQL Driver by Microsoft and added it into PHP Extension Dir and installed Microsoft SQL Server 2012 Express on my own computer.

Any help would be much appreciated.

[eluser]Iszuddin Ismail[/eluser]
you can also check that you have the right firewall setting for your DB in the management portal... it should at least allow to for your internal Azure instances.

I have already added the IP Address that is allowed to access Azure SQL.

[eluser]Iszuddin Ismail[/eluser]
I got it...

$db['default']['pconnect'] = FALSE;

Just turn that to FALSE and you should be OK, assuming everything else is correct.

Hello. You managed to got it to work?

I have set it to FALSE and it throws an error.

PHP Fatal error: Call to undefined function sqlsrv_connect() in /Applications/MAMP/htdocs/ProTeach/system/database/drivers/sqlsrv/sqlsrv_driver.php on line 76
I'm using CI 2.1.0

[eluser]Iszuddin Ismail[/eluser]
first of all, why is this in MAMP... I thought this is in Azure. And secondly, if you get that, perhaps you don't have the extension enabled. You need the sqlsrv extension turned on.

I'm running the web application on my own computer trying to connect to the Azure SQL Server.

I'm interested in trying CodeIgniter with Azure SQL.

If you got it to work, can you describe what you needed to do to get it to work please?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.