Home > unable to > codeigniter error unable to select the specified database

Codeigniter Error Unable To Select The Specified Database

Contents

here for a quick overview of the site Help Center

Unable To Select The Specified Database Filename Core/loader.php Line Number 346

Detailed answers to any questions you might have Meta codeigniter unable to select the specified database db_driver php Discuss the workings and policies of this site About Us Learn more about Stack Overflow

Codeigniter Unable To Connect To Your Database Server Using The Provided Settings.

the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x a database error occurred codeigniter Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Codeigniter : Showing error as ' Unable to select the specified database: project' in Windows XP up vote db_driver.php line number 124 5 down vote favorite 1 I am using Windows XP and using EasyPHP as a server. I have integrated Codeigniter with TankAuth. But, when I try to open my assignment folder, it shows 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 database .php 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 have checked my database.php, inside it I have database name as 'project'. I have tried with hostname both as 'localhost' and as '127.0.0.1', but none worked. I have set my default controll

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up codeigniter A Database Error Occurred up vote 3 down vote favorite Can someone http://stackoverflow.com/questions/15503757/codeigniter-showing-error-as-unable-to-select-the-specified-database-projec help me? I am a beginner and trying to make wearing CodeIgniter authentication, but when I try to make an error like this A Database Error Occurred Error Number: 1046 No database selected SELECT * FROM (`user`) WHERE `user_username` = 'amanda' AND user_passwordMD5("12345") = Filename: C:\xampp\htdocs\codeigniter\system\database\DB_driver.php Line Number: 330 thanx codeigniter share|improve this question edited Apr 5 '14 at 6:13 Subodh Ghulaxe 8,75065380 asked Apr 5 '14 at 6:05 http://stackoverflow.com/questions/22877227/codeigniter-a-database-error-occurred Revoir Hz 1816 can you please make sure you have setup database configuration in config/database.php file –user3470953 Apr 5 '14 at 6:08 Please refer to the Codeignitor documentation before jumping to the coding. –dikesh Apr 5 '14 at 6:13 did any of the answer work !!! –saurabh kamble Apr 5 '14 at 7:04 thank you for giving advice, I do not have any information about documentnya and practice that the less I understand –Revoir Hz Apr 5 '14 at 7:14 add a comment| 3 Answers 3 active oldest votes up vote 1 down vote accepted Check the database.php file in application/config/ $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'root'; $db['default']['password'] = 'mypassword'; $db['default']['database'] = 'my_database'; // here is the database selection share|improve this answer answered Apr 5 '14 at 6:12 ReNiSh A R 1,57021232 I have tried it and then appear again error like this A Database Error Occurred Unable to select the specified database: authtentication Filename: C:\xampp\htdocs\codeigniter\system\database\DB_driver.php Line Number: 140 –Revoir Hz Apr 5 '14 at 7:15 have you specified the db on database.php –ReNiSh A R Apr 5 '14 at 7:23 $db['default']['hostname'] = 'localhost'; $db['default']['username'] = ''; $db['default']['password'] = ''; $db['default']['database'] = 'authtentication

to select the specified database Thread Closed 0 Vote(s) - 0 Average 1 2 3 4 5 Thread Modes Unable http://forum.codeigniter.com/thread-45088.html to select the specified database El Forum Unregistered #1 https://codedump.io/share/NVc6NKFk6ZzN/1/codeigniter-redirect-to-custom-view-when-unable-to-select-database 09-07-2011, 04:19 PM [eluser]Unknown[/eluser] Hello, Good morning / good evening (whatever is applicable) to all of you! I'm both a newbie to this site and Code Igniter as well. First of all I would like to thank the authors of CI, the unable to members of this forum, and all the contributors. Using CI made my coding life much much easier! Anyway, could you kindly help me with the issue I'm facing now? Here's the description: I have developed a web application using CI 2.0.1 on my computer. I run it locally using wampserver. After everything was unable to select finished I thought of uploading it to the web hosting service I have subscribed to. The problem is that I cannot seem to make the application connect to the database, here's the error message being thrown back at me: Quote:A Database Error Occurred Unable to select the specified database: mydb Filename: core/Loader.php Line Number: 232 I verified that the myslq database is existing in the webhost server, and my connection details (I guess) are correct. Here are the settings on the database.php file: Code: $db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'myuser';
$db['default']['password'] = 'mypass';
$db['default']['database'] = 'mydb';
$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 do not encounter this on the development environment (my computer running on wampserver).

Gherkin Git Go Groovy Haml Handlebars Haskell HTML HTTP Ini iOS Jade Java Javascript jQuery JSON Julia Keyman LaTeX Linux Less LOLCODE Makefile Markdown MATLAB MySQL NASM Node.js NSIS Objective-C Pascal Perl PHP PHP Extras PowerShell Python R React JSX reST (reStructuredText) Rip Ruby Rust SAS Sass (Sass) Sass (Scss) Scala Scheme Smalltalk Smarty SQL Stylus Swift Twig TypeScript Vb.net VHDL Wiki markup YAML Other Search Anonymous - 9 months ago 168x PHP Question Codeigniter redirect to custom view when Unable to select database I'm trying to find a way to redirect my codeigniter application to a custom link (controller/method) where i can custom the content from my views folder only when this error occured. A Database Error Occurred

Unable to select the specified database: *******

Filename: core/Loader.php

Line Number: 347
I tried to custom the file errors/error_db.php, but it's not what i want, because the file includes all database errors and i want to keep it intact, or if there is a way to do an if-else in this file to redirect only if this error : "Unable to select the specified database" occured. Anonymous Answer Email {} Share Replace this with your "errors/error_db.php" Note that redirect function needs url library to be loaded already. Database Error