开发者社区> 问答> 正文

使用PHPMyAdmin拒绝用户'root'@'localhost'的访问?mysql

当我在PHPMyAdmin中设置root密码时,出现以下错误:

#1045 - Access denied for user 'root'@'localhost' (using password: NO) 我无法打开PHPMyAdmin面板。我究竟做错了什么?

展开
收起
保持可爱mmm 2020-05-17 21:41:31 1208 0
1 条回答
写回答
取消 提交回答
  • 编辑您的phpmyadmin config.inc.php文件,如果您有密码,请在以下代码中将其插入密码前面:

    $cfg['Servers'][$i]['verbose'] = 'localhost'; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['port'] = '3306'; $cfg['Servers'][$i]['socket'] = ''; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['extension'] = 'mysqli'; $cfg['Servers'][$i]['auth_type'] = 'config'; $cfg['Servers'][$i]['user'] = 'your-root-username'; $cfg['Servers'][$i]['password'] = 'root-password'; $cfg['Servers'][$i]['AllowNoPassword'] = true;来源:stack overflow

    2020-05-17 21:43:56
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
搭建电商项目架构连接MySQL 立即下载
搭建4层电商项目架构,实战连接MySQL 立即下载
PolarDB MySQL引擎重磅功能及产品能力盛大发布 立即下载

相关镜像