Mysql
 sql >> Datenbank >  >> RDS >> Mysql

PHP MYSQL konnte keine Verbindung herstellen (HY000/2002)

Sie müssen den username angeben und password für Ihr MySQLi Verbindung.

require_once 'Internal/Var.php';
// Remove the two procedural connection lines here

function create_connection()
{
    // Make sure D_SERVER, D_USER, D_PASSWORD, D_NAME have the correct values
    // These values are probably created in Internal/Var.php
    $conn = new mysqli(D_SERVER, D_USER, D_PASSWORD, D_NAME);

    return $conn;
}

function close_connection(mysqli $con)
{
    $con->close();
}