CodeIgniter Forums
unable to connect to database server with provided setting - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: unable to connect to database server with provided setting (/showthread.php?tid=24794)



unable to connect to database server with provided setting - El Forum - 11-19-2009

[eluser]Pramod[/eluser]
I am using codeIgnitor and oracle 10g for application development. I am using linux server. message "Unable to connect database server ....." is seen. Can anybody help me??

Thnaks in advance.


unable to connect to database server with provided setting - El Forum - 11-19-2009

[eluser]kikz4life[/eluser]
post your code and did you check your connection setting in database.php?


unable to connect to database server with provided setting - El Forum - 11-20-2009

[eluser]Pramod[/eluser]
I have centOS version 5.1 server and database is 10g 2.0 oracle version. I have set the sid and username and password correctly. It was formerly working in another server. But now it give the error "Unable to connect database server using provided setting". Apache version is 2.2.4. and php version is 5.1.2.


unable to connect to database server with provided setting - El Forum - 11-20-2009

[eluser]rogierb[/eluser]
Your connection settings are wrong. It's that simple. Check your settings, not only in database.php but at your database server aswell. The fact it was working at a previous server should give you a hint at where to start.


unable to connect to database server with provided setting - El Forum - 11-29-2009

[eluser]Pramod[/eluser]
Problem is solved now. I have kept the connection string for sid. I replaced it with database hostname. Now it works.


unable to connect to database server with provided setting - El Forum - 12-27-2009

[eluser]alejandronanez[/eluser]
Hey I have a problem with my Oracle 10g XE data base

Code:
$db['default']['hostname'] = "//127.0.0.1/apex";
$db['default']['username'] = "sig";
$db['default']['password'] = "sig";
$db['default']['database'] = "";
$db['default']['dbdriver'] = "oci8";

is that right?

Ci says this:

Quote:A Database Error Occurred

Unable to connect to your database server using the provided settings.

Please! I need HELP!

Bye!


unable to connect to database server with provided setting - El Forum - 12-28-2009

[eluser]Pramod[/eluser]
Hello alejandronanez,
if you have your database installed in another server then you should assign hostname like this

Code:
$sid = "(DESCRIPTION =
                            (ADDRESS_LIST =
                            (ADDRESS = (PROTOCOL = TCP)(HOST = ".$dbhost.")(PORT = ".$dbport."))
                            )
                            (CONNECT_DATA =
                                (SERVICE_NAME = ".$dbname.")
                            )
                       ) ";
Code:
//$dbport=1521
//$dbhost=Database Server's IP Address
//$dbname=Database name

now you have connection setting as

Code:
$db['default']['hostname'] = $sid;
$db['default']['username'] = 'sig';
$db['default']['password'] = 'sig';
$db['default']['database'] = "";
$db['default']['dbdriver'] = "oci8";

If database server and apache server is in same machine you can directly use

Code:
$db['default']['hostname'] = 'sid';//only the database name
$db['default']['username'] = 'sig';
$db['default']['password'] = 'sig';
$db['default']['database'] = "";
$db['default']['dbdriver'] = "oci8";



unable to connect to database server with provided setting - El Forum - 12-29-2009

[eluser]alejandronanez[/eluser]
HEy, I;m using Oracle 10g XE , is the database called 'XE' ?

Thanks!!!


unable to connect to database server with provided setting - El Forum - 12-29-2009

[eluser]alejandronanez[/eluser]
Hey, here's my original POST, there's more information about the problem with the connection.

My post - Ci Forums

I really appreciate your help.

Bye Smile