• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database wont connect

#1
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.
Reply

#2
can you connect mysql via phpmyadmin?
Reply

#3
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
Reply

#4
You change "hostname" to "127.0.0.1".
Lê Trung Hiếu
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.