【问题标题】:Access denied with localhost [closed]使用 localhost 拒绝访问 [关闭]
【发布时间】:2014-12-21 12:37:41
【问题描述】:

我试图为我的 phpmyadmin 设置密码,因为有一条通知要求我这样做。当我使用 sql 选项执行此操作时,我输入了此代码

`SET PASSWORD FOR root@localhost = PASSWORD('your_root_password`');

当我执行此代码时,它拒绝我访问我的 phpmyadmin。

我现在每次访问 localhost/phpmyadmin 时都会收到此错误

"#1045 - Access denied for user 'root'@'localhost' (using password: NO)".

有什么办法解决这个问题吗?

【问题讨论】:

  • 你的mysql有密码吗?重新安装吧,因为你可能安装错了
  • 不是我的 sql,但我在 phpmyhost 中使用 mysql 选项为 phpmyadmin 设置密码,但这拒绝了我访问服务器

标签: php mysql sql phpmyadmin


【解决方案1】:

在您的 PMA 文件夹中打开“config.inc.php”。

加入此行提示登录前的认证

$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* $cfg['Servers'][$i]['user'] = 'root'; */
/* $cfg['Servers'][$i]['password'] = ''; */

或通过此行手动定义您的身份验证

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'yourpassword';

【讨论】:

    猜你喜欢
    • 2012-01-27
    • 1970-01-01
    • 2014-11-19
    • 2016-07-28
    • 1970-01-01
    • 2019-04-30
    • 2021-09-17
    • 2019-12-11
    • 1970-01-01
    相关资源
    最近更新 更多