Bazinga777
Bazinga777

Reputation: 5281

Setting up cleardb for codeigniter on heroiku

I am using cleardb on heroku to setup a codeigniter application but I have been getting errors even though the values I have inserted were all correct. I am providing all the details of the configuration below as this is just a test app. I am also posting a screen shot of the errors, any tips would be appreciated. Please do not tell me about how i should use mysqli or PDO instead of this as I have looked at the support and it doesn't exist yet.

$active_group = 'default';
$active_record = TRUE;

$url=parse_url(getenv("mysql://be581f53f6c3cc:[email protected]/heroku_29745033f6a8f32?reconnect=true"));


$db['default']['hostname'] = 'us-cdbr-east-05.cleardb.net';
$db['default']['username'] = $url["be581f53f6c3cc"];
$db['default']['password'] = $url["e3dffb73"];
$db['default']['database'] = substr($url["heroku_29745033f6a8f32"],1);
$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;

Here are the errors enter image description here

Upvotes: 0

Views: 1123

Answers (2)

Deepak3301086
Deepak3301086

Reputation: 487

I created connection in a simple way

$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'us-cdbr-iron-east-01.cleardb.net';
$db['default']['username'] = 'b20a.....';
$db['default']['password'] = '26e9...';
$db['default']['database'] = 'heroku_5....';
$db['default']['dbdriver'] = 'mysql';

and just update composer.json as

{
    "require": {
        "ext-mysql": "*",
        "monolog/monolog": "1.2.*"
    }
}

and then run

composer install

then

git add .
git commit -m
git push .............

and it's working fine.

Upvotes: 0

Radu Vlad
Radu Vlad

Reputation: 1514

Don't know if this is still active, but you should install composer, enable mysql in composer.json like this:

{
"require": {
    "ext-mysql": "*"
   }
}

and then run

composer install 

For more information you can check this

Upvotes: 1

Related Questions