Codeigniter : Showing error as ' Unable to select the specified database: project' in Windows XP

强颜欢笑 提交于 2019-12-05 06:03:38

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.

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.

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.

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

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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!