Welcome Guest, Not a member yet? Register   Sign In
I always get mysqli_sql_exception #2002
#1

Hi, I am new to Ci. I have completed a few tutorials and everything works OK until I get to connecting to MySQL. I am using MAMP pro, a Macbook pro and Mac OS. 

mysqli_sql_exception #2002

SYSTEMPATH/Database/MySQLi/Connection.php at line 225

---------------

This is what I have done so far to debug:

I have found a way to get the page to load, run PHP and display data from the database -> I turned on 'Allow network Access to MySQL' in MAMP and ran the index.php file in the public folder. The error went away and I see the page loading -> so the code is not incorrect. Interestingly, when I 'Allow network Access to MySQL' and try to view the project in my browser, I get the MySQL connection error.

Every time, I try to 'php spark serve' and run the application on localhost:8080 -> I get the error mysqli_sql_exception #2002 where Ci can't connect to MySQL.

--------------

I have seen a fgew other posts on Stack Exchange and also on the Ci form about this. Does anyone know how to fix it?

I am assuming, I should always use 'php spark serve' and not open the file in a path within my htdocs?

Attached Files Thumbnail(s)
       
Reply


Messages In This Thread
I always get mysqli_sql_exception #2002 - by sebgates - 06-01-2020, 06:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB