skip to Main Content

This is the error message I got after I tried to make a password and username for localhost and root. Please help me. I am using Mac by the way.

MySQL said: Documentation

Cannot connect: invalid settings.

mysqli::real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO)

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

3

Answers


  1. go to xamppmysqlbinmy.ini and open it. change the port to 3307
    and go to xamppphpMyAdminconfig.inc.php and check the name of the host
    $cfg['Servers'][$i]['host'] = 'localhost:3307';

    Login or Signup to reply.
  2. Adding to soufiane’s answer above, there is actually 2 more places where you have to make the same change:

    1. xampp window: config > Service and Port Settings > mysql > Change port to 3307
    2. add $cfg['Servers'][$i]['port'] = 3307; to phpMyAdminconfig.inc.php

    For a complete start to finish solution, refer to this answer on Quora by Owais R. Mir: https://www.quora.com/How-do-I-change-the-port-of-a-MySQL-server-in-XAMPP/answer/Owais-R-Mir

    PS:
    I used this solution to run mysql from xampp on port 3307 because I had installed mysql separately before and it was using port 3306. When ports are reset for xampp mysql you avoid issues with initializing and signing in to your local database via phpmyadmin.

    Login or Signup to reply.
    1. So , you have to open XAMPP Control Panel –> Click MySql Config- >Click my.ini

    2. You have to write this line skip-grant-tables after [mysqld].

    3. Open xamp folder ->PhpMyAdmin .You will see config.inc.php file in phpMyAdmin folder, just open it with notepad++
      $cfg[‘Servers’][$i][‘host’] = ‘127.0.0.1’; This is default port number.

    4. Resolve this issue by manually editing in the file “config.inc.php” located at “C:xamppphpMyAdmin”. Write “localhost:3307” <— Your port PhpMyAdmin within $cfg[‘Servers’][$i][‘host’] = ‘localhost:3307′;<— Your port PhpMyAdmin

    5. Save this changes. You can find port number as follows: Open XAMP–>config–>service port setting–>mySql.edit port 3307

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