CodeIgniter Forums
Database wont connect - Printable Version

+- CodeIgniter Forums (
+-- Forum: Using CodeIgniter (
+--- Forum: Installation & Setup (
+--- Thread: Database wont connect (/thread-72618.html)

Database wont connect - chung1412 - 01-14-2019

Good day codeigniter forum,

I just changed to MAC environment and whenever I load the codeigniter index page , I will have error connecting to localhost.

Severity: Warning
Message: mysqli::real_connect(): (HY000/2002): Connection refused
Filename: mysqli/mysqli_driver.php
Line Number: 201

Does anyone know how to solve this issue?

On window environment, I can set this up in ease. All i need to do is to input the correct info at the database.php file.

But on my mac environment, my XAMPP could not load localhost/dashboard , instead I need to add in the port number localhost:8080/dashboard in order to load that particular page.

RE: Database wont connect - sametaras - 01-15-2019

can you connect mysql via phpmyadmin?

RE: Database wont connect - snelledre - 01-15-2019

I have also a Mac and I use Mamp without problems on port 80 with Codeigniter 3 and 4.
So I can advice you to use Mamp.


RE: Database wont connect - filiallion - 01-21-2019

You change "hostname" to "".