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;
}

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.



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.

so anyone please guide me to comeout with this issue.

Thanks
Harsh
#2

[eluser]Harsh[/eluser]
I dont think issue is related with config folder database.php file because the re i have given correct database name

find the example
$active_group = “default”;
$active_record = TRUE;

$db[‘default’][‘hostname’] = “localhost”;
$db[‘default’][‘username’] = “root”;
$db[‘default’][‘password’] = “”;
$db[‘default’][‘database’] = “tes123”;
$db[‘default’][‘dbdriver’] = “mysql”;
$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”;

Thanks
Harsh
#3

[eluser]InsiteFX[/eluser]
How many threads are you going to post this in this is your 3rd post on the same problem?

InsiteFX
#4

[eluser]toopay[/eluser]
@Hars
Please, dont take what i or InsiteFX mention in other threads, in wrong way. But, it seems to us, that you didn't really set your database properly. This turorial will give you a quick start, to PHP MYSQL, after you read that, try that, then still have a problems, you can back to this forums and we'll loved to help you.




Theme © iAndrew 2016 - Forum software by © MyBB