CodeIgniter Forums
Database wont connect - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forum-9.html)
+--- 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.

Andre


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

You change "hostname" to "127.0.0.1".