phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO)

后端 未结 16 846
谎友^
谎友^ 2020-12-05 00:17

I keep getting the following errors with mysql connection through XAMPP and I don\'t know what to do:

That\'s the code in the config.inc.php



        
16条回答
  •  情歌与酒
    2020-12-05 00:19

    In terminal, log into MySQL as root. You may have created a root password when you installed MySQL for the first time or the password could be blank, in which case you can just press ENTER when prompted for a password.

     sudo mysql -p -u root
    

    Now add a new MySQL user with the username of your choice. In this example we are calling it pmauser (for phpmyadmin user). Make sure to replace password_here with your own. You can generate a password here. The % symbol here tells MySQL to allow this user to log in from anywhere remotely. If you wanted heightened security, you could replace this with an IP address.

    CREATE USER 'pmauser'@'%' IDENTIFIED BY 'password_here';
    

    Now we will grant superuser privilege to our new user.

    GRANT ALL PRIVILEGES ON *.* TO 'pmauser'@'%' WITH GRANT OPTION;
    

    Then go to config.inc.php ( in ubuntu, /etc/phpmyadmin/config.inc.php )

    /* User for advanced features */

    $cfg['Servers'][$i]['controluser'] = 'pmauser'; 
    $cfg['Servers'][$i]['controlpass'] = 'password_here';
    

提交回复
热议问题