php DB connection

Asked 2 years ago, Updated 2 years ago, 35 views

I want to do PHP using Bitnami. By the way, I'm trying to connect the DB

Access denied for user 'root'@'localhost' (using password: YES)

This is the only error I see.

cmd and phpMyAdmin connect DB The password is correct.

What should I do??

<?php
    $conn=new mysqli('localhost', 'root', '"db');
    if($conn->connect_error) {
        print $conn->connect_error;
    }
?>

php database

2022-09-21 11:53

1 Answers

$mysqli = new mysqli("127.0.0.1", "user", "password", "database", 3306);

In this way, instead of 'localhost', try specifying the loopback IP, database name, and port.


2022-09-21 11:53

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.