skip to Main Content

I tried testing my php software with Xammp (Local Host) but after hitting the url, i kept getting:

Fatal error: Uncaught mysqli_sql_exception: Access denied for user 'Adeleke'@'localhost' (using password: YES)

I thought it was from xammp PhpMyAdmin so i installed laragon nd tried testing the software on it, below is what it shows

Fatal error: Uncaught mysqli_sql_exception: Access denied for user 'Adeleke'@'localhost' (using password: YES) in C:laragonwwwMyQueerDateinstallindex.php:47 Stack trace: #0 C:laragonwwwMyQueerDateinstallindex.php(47): mysqli_connect('127.0.0.1', 'Adeleke', 'Badvibe019!', 'Laragon.MySQL') #1 {main} thrown in C:laragonwwwMyQueerDateinstallindex.php on line 47

Here is the code on MyQueerDateinstallindex.php on line 46 – 49:

if (!empty($_POST['install'])) {
   $con = mysqli_connect($_POST['sql_host'], $_POST['sql_user'], $_POST['sql_pass'], $_POST['sql_name']);
   if (mysqli_connect_errno()) {
       $ServerErrors[] = "Failed to connect to MySQL: " . mysqli_connect_error();

I was try to chech the output of the software and view the dashboard and the admin panel but it kept on showing;

Fatal error: Uncaught mysqli_sql_exception: Access denied for user 'Adeleke'@'localhost' (using password: YES) in C:laragonwwwMyQueerDateinstallindex.php:47 Stack trace: #0 C:laragonwwwMyQueerDateinstallindex.php(47): mysqli_connect('127.0.0.1', 'Adeleke', 'Badvibe019!', 'Laragon.MySQL') #1 {main} thrown in C:laragonwwwMyQueerDateinstallindex.php on line 47

I tried it on cpanel and it works but i dont want to be testing softwares on cpanel, i cant affford paying hosting fees for now and i want to try localhost.

2

Answers


    1. Check user and login permissions
      select user,host from mysql.user;
      If you are in this list, you can connect normally
    2. Check whether the password is correct
    3. You can try to use mysql -uusername -ppassword to log in on the mysql server, you can better get the cause of the error, and then improve
    Login or Signup to reply.
  1. create a new user and use it to get access to your database.

    Query:
    create user ‘user’@’localhost’;
    GRANT ALL PRIVILEGES ON urdatabase.* To ‘user’@’localhost’ IDENTIFIED BY ‘password’;

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search