Welcome Guest, Not a member yet? Register   Sign In
unable to select specified database error
#1

[eluser]Harsh[/eluser]
Hi,

i am facing a error but i am not able to know the exact region.
sometimes once i want to login it is giving me error “unable to select specified database :database name”.

once i have modified the DB_driver.php in database folder it is working fine.For that i have commented that area(marked in red)and there i have written connection string then it is working.

I have done something like this:-

// Select the DB… assuming a database name is specified in the config file
if ($this->database != ‘’)

{
if ( ! $this->db_select())
{

log_message(‘error’, ‘Unable to select database: ‘.$this->database);

/*if ($this->db_debug)
{
$this->display_error(‘db_unable_to_select’, $this->database);
}
*/

$conn=mysql_connect(“localhost”,“root”,”“) or die(“unable to connect localhost”.mysql_error());
$this->conn_id = $conn;
$db=mysql_select_db(“egoalsheet”,$conn) or die(“unable to select egoalsheet”);
return TRUE;
}

so anyone please guide me to comeout with this issue.

Thanks
Harsh
#2

[eluser]Harsh[/eluser]
actually we are using wamp server. (Windows)
We have already probed into the fact of too many connections , sleep connections in mysql and hence restarted WAMP last nite. The server was up and running for say 3 hours and then again went down with the same error midnight. we had to revoke our patch to make it up.

So back to square one, we right now have no clue about it, please suggest the probable areas we can look into.
OR if anyone has faced similar issue.

Thanks
Harsh
#3

[eluser]Bart v B[/eluser]
too many connections means that you use pc_connect()
By default codeigniter is using it.
You can turn that off in your /config/database.php

Code:
$db['default']['pconnect'] = TRUE; // set it to FALSE




Theme © iAndrew 2016 - Forum software by © MyBB