Codeigniter : Showing error as ' Unable to select the specified database: project' in Windows XP
I was facing a similar problem but unfortunately none of the answers on any site helped. The weird thing was that I was easily able to connect to MySQL using simple PHP but in CodeIgniter I was getting this message.
Finally this 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 to mysqli
saved by day.
The error is stating that it has successfully connected to your database software, but it cannot find the specified DB named project
. Check your DB connections and make sure they are all correct -- it sounds like your database name should be assignment
instead.
Edit: Check to make sure the DB user your are logging in as has permission to access the specified database, also.
Maybe this will save someone sometime - I was using cPanel and it has a certain rule that a user has to be tied to a database to access it. I was getting the same error, but because I did not have the permissions, I could not access it.
In cPanel go to MySQL Databases, find your user and add this user to your database.