Alright, I just found the solution. The problem turned out to be that the host shouldn’t have been localhost
, but 127.0.0.1
. I always thought localhost
and 127.0.0.1
was the same, but it turned out to be different.
So maybe as a tip for future users, always use the ip when in doubt.
More Related Contents:
- Can I mix MySQL APIs in PHP?
- How to change mysql to mysqli?
- How to prevent duplicate usernames when people register?
- Best way to INSERT many values in mysqli?
- SELECT COUNT(*) AS count – How to use this count
- How to use mysqli prepared statements?
- MySQLi prepared statements error reporting [duplicate]
- mysqli last insert id
- mysqli: can it prepare multiple queries in one statement?
- CodeIgniter: Unable to connect to your database server using the provided settings Error Message
- How to call a MySQL stored procedure from within PHP code?
- MySQLi count(*) always returns 1
- Do I have to guard against SQL injection if I used a dropdown?
- Using MySQLi from another class in PHP
- How do I display a MySQL error in PHP for a long query that depends on the user input? [duplicate]
- Call to a member function execute() on boolean in [duplicate]
- Mysql No connection could be made because the target machine actively refused it
- Unknown database error in PHP but it exists in PHPMyAdmin
- Fatal error: Uncaught exception ‘mysqli_sql_exception’ with message ‘No index used in query/prepared statement’
- Can I blindly replace all mysql_ functions with mysqli_?
- Fatal error: Call to undefined function mysqli_result()
- Using PHP to execute multiple MYSQL Queries
- Fatal error: Call to undefined method mysqli_stmt::fetch_array() [duplicate]
- How to run multiple insert query in SQL using PHP in one go?
- mysqli prepared statement num_rows returns 0 while query returns greater than 0 [duplicate]
- Using Prepared Statement, how I return the id of the inserted row?
- Which is fastest in PHP- MySQL or MySQLi?
- When should I close a database connection in PHP?
- MySqli Commands out of sync; you can’t run this command now [duplicate]
- How to make mysqli connect function?