#1130 - Host ‘localhost’ is not allowed to connect to this MySQL server

后端 未结 3 1589
耶瑟儿~
耶瑟儿~ 2020-12-01 22:36

I issued a command of:

DROP USER \'root\'@\'localhost\'; GRANT ALL PRIVILEGES ON . TO \'root\'@\'%\';

...in PhpMyAdmin. Immediately after t

相关标签:
3条回答
  • 2020-12-01 23:18

    Use the IP instead:

    DROP USER 'root'@'127.0.0.1'; GRANT ALL PRIVILEGES ON . TO 'root'@'%';
    

    For more possibilities, see this link.

    To create the root user, seeing as MySQL is local & all, execute the following from the command line (Start > Run > "cmd" without quotes):

    mysqladmin -u root password 'mynewpassword'
    

    Documentation, and Lost root access in MySQL.

    0 讨论(0)
  • 2020-12-01 23:22

    Find the file "config.inc.php" under your phpMyAdmin directory and edit the following lines:

    $cfg['Servers'][$i]['auth_type'] = 'config'; // config, http, cookie

    $cfg['Servers'][$i]['user'] = 'root'; // MySQL user

    $cfg['Servers'][$i]['password'] = 'TYPE_YOUR_PASSWORD_HERE'; // MySQL password

    Note that the password used in the 'password' field must be the same for the MySQL root password. Also, you should check if root login is allowed in this line:

    $cfg['Servers'][$i]['AllowRoot']     = TRUE;        // true = allow root login
    

    This way you have your root password set.

    0 讨论(0)
  • 2020-12-01 23:28

    Use this in your my.ini under

    [mysqldump]
        user=root
        password=anything
    
    0 讨论(0)
提交回复
热议问题