CLI Codeigniter controller crash

So I followed this tutorial

and i tried to do

   php index.php tools message


but I am getting this error in terminal:

   <h1>A Database Error Occurred</h1>
   <p>Unable to connect to your database server using the provided settings.</p>
   <p>Line Number: 98</p>   


I need this in order to bake assets using the Sprinkle library from I have been browsing the forum but I cannot find a specific solution to this problem. So, I need to save.

I am using php version 5.3.1 and latest codeigniter.

Any help would be greatly appreciated, thanks! :)


source to share

2 answers

Are you working locally?

If so, try changing the hostname from

$db['default']['hostname'] = 'localhost';



$db['default']['hostname'] = '';




It doesn't seem to be able to connect to your database. Have you checked your database settings in the database.php config file if correct?

If you are using multiple environments, check the part where you install the environment. Perhaps he chose the wrong one.

You can also enable logs in your config.php file and check them.



All Articles