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

#1
[eluser]ZachFX[/eluser]
Hi,

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

Code:
$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.

#2
[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 0.0.0.0 to 0.0.0.0 for your internal Azure instances.

#3
[eluser]ZachFX[/eluser]
I have already added the IP Address that is allowed to access Azure SQL.

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

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

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

#5
[eluser]ZachFX[/eluser]
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

#6
[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.

#7
[eluser]ZachFX[/eluser]
I'm running the web application on my own computer trying to connect to the Azure SQL Server.

#8
[eluser]Giords[/eluser]
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?

Thanks


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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