0

Trying to get a sql database using phpmyadmin on xampp to show up on my website. Made sure the password is correct in the config file.

My relevant code to the problem is here,

<?php
$host    = "localhost";
$user    = "root";
$pass    = "password";
$db_name = "sublog";

//create connection
$connection = mysqli_connect($host, $user, $pass, $db_name);

//test if connection failed
if(mysqli_connect_errno()){
    die("connection failed: "
        . mysqli_connect_error()
        . " (" . mysqli_connect_errno()
        . ")");
}

I tried quite a few solutions from similar questions on here. Tried my ip address as host, ip address with the sql port at the end, tried root without and with password, and still no luck. Pretty new to this so not sure where to go next.

Dharman
  • 21,838
  • 18
  • 57
  • 107
  • 1
    Does this answer your question? [MySQL ERROR 1045 (28000): Access denied for user 'bill'@'localhost' (using password: YES)](https://stackoverflow.com/questions/10299148/mysql-error-1045-28000-access-denied-for-user-billlocalhost-using-passw) – Dharman May 17 '20 at 12:07

0 Answers0