I'm getting an error when I start the installation process, i.e., <domain>/admin.

Here's the error I'm getting:

CDbCommand failed to execute the SQL statement: SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected. The SQL statement executed was: SHOW TABLES LIKE 'craft_%'

Since I've enabled dev mode, you can see the full stack trace here:


I've done the following prior to starting the install:

  • set up db and identified server, db name, user, & password that are needed

  • put proper settings in db.php in the config folder

  • put the craft folder one level above web root

  • updated all 3 of the relevant folder permissions (including enclosed)

  • enabled dev mode in general.php

I even added a statement to craft/etc/behaviors/AppBehaviors.php. After line 852, at which point the db connection appears to be valid, I echo'd a "db connection is valid" line and got there. That line is now commented out.

I'd love to hear your thoughts on what I might try to fix this.

Contents of config/db.php:


* Database Configuration
* All of your system's database configuration settings go in here.
* You can see a list of the default settings in craft/app/etc/config/defaults/db.php

return array(

// The database server name or IP address. Usually this is 'localhost' or ''.
'server' => 'internal-db.s<my acct #>.gridserver.com',

// The name of the database to select.
'd<my acct #>_onehanders_db' => '',

// The database username to connect with.
'user' => 'db<my acct #>',

// The database password to connect with.
'password' => '<my password>',

// The prefix to use when naming tables. This can be no more than 5 characters.
'tablePrefix' => 'craft',

  • Shot in the dark, but try this fix: craftcms.com/support/forms-returning-json
    – Brad Bell
    Apr 2, 2016 at 23:19
  • Thanks for the try Brad, but I've already done that. Apr 3, 2016 at 17:02
  • Can you share the contents of your craft/config/db.php file (with the sensitive bits redacted)?
    – Brad Bell
    Apr 3, 2016 at 20:57
  • Sure. I'll edit the post to include it. Apr 3, 2016 at 21:53
  • Added an answer.
    – Brad Bell
    Apr 3, 2016 at 22:25

1 Answer 1



// The name of the database to select.
'd<my acct #>_onehanders_db' => '',

Needs to be this:

// The name of the database to select.
'database' => 'd<my acct #>_onehanders_db',
  • Thanks Brad. That was a rather egregious error. My apologies. Apr 3, 2016 at 23:25
  • I forgot to say, explicitly...that worked! My installation was successful. Thanks again. Apr 3, 2016 at 23:31
  • No worries, @BobMonsour. And bonus points for using the word "egregious". :)
    – Brad Bell
    Apr 3, 2016 at 23:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.