Codeigniter: Shows an error like "Unable to select the specified database: project" in Windows XP

I use Windows XP and use EasyPHP as a server. I integrated Codeigniter with TankAuth. But when I try to open the destination folder, it shows an error as follows:

Unable to select the specified database: project Filename: C:\Program Files\EasyPHP-12.1\www\assignment\system\database\DB_driver.php Line Number: 140 

The code inside my .php database is as follows:

 $active_group = 'default'; $active_record = TRUE; $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'root'; $db['default']['password'] = 'root123'; $db['default']['database'] = 'project'; $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'; $db['default']['swap_pre'] = ''; $db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE; 

I checked my database.php file, inside it I have the database name as "project".

I tried with the host name as "localhost" and "127.0.0.1", but no one worked.

I set my default controller to "auth", i.e. The default controller is TankAuth.

And initialized the library "database" in the construction in the controller "auth".

Now I have tried the same using Wamp Server. But, got the same result.

Somewhere I read that I should try to do $db['default']['pconnect'] and

$db['default']['db_debug'] before FALSE . But that did not work.

And all access permissions were granted to the database project.

Is there anything I should try to get it to work?

Thanks in advance...

+7
source share
5 answers

This error indicates that it is successfully connected to your database software, but cannot find the specified DB named project . Check the database connections and make sure they are all correct - it looks like there should be an assignment instead of your database name.

Change Make sure that the database user is logged in with the access rights to the specified database.

+10
source

I had a similar problem, but, unfortunately, none of the answers on any site helped. The strange thing was that I could easily connect to MySQL using simple PHP, but in CodeIgniter I received this message.

Finally, it solved my problem. Open the application/config/database.php file and change the following line:

 $db['default']['dbdriver'] = 'mysql'; 

To:

 $db['default']['dbdriver'] = 'mysqli'; 

This shift in mysqli saved per day.

+20
source

Try this: just upgrade your db software. If you are using PHPMy Admin, refresh the page and try loading the PHP page. or if you have a stored procedure in your db, this may cause a problem. try deleting stored procedures.

+1
source

Perhaps this will someday save some money - I used cPanel and it has a certain rule that the user must bind to the database to access it. I was getting the same error, but since I did not have access rights, I could not access it.

In cPanel, go to MySQL Databases, find your user and add that user to your database.

+1
source
 Notice: SQL safe mode in effect – ignoring host/user/password information in mysql_connect(): SQL safe mode in effect – ignoring host/user/password information in This is caused due to your php.ini sql safe mode settings. Login your php.ini file. Go php.ini from apache and turn off sql.safe mode. [SQL] sql.safe_mode = Off Restart apache 
0
source

All Articles