在 EasyPHP{WAMP} 中设置 root 密码后无法从 phpMyAdmin 访问 MySQL

发布于 2024-08-27 08:54:00 字数 550 浏览 3 评论 0原文

首次启动 MySQL 成功设置后,出于安全原因,页面提示我设置 ROOT 密码。

设置密码后,我无法再访问 MySQL。错误是:

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

在网上查找并尝试了phpmyadmin文件夹中的config.inc.php中的以下选项:

  1. 将身份验证设置为“http”,以便提示输入用户名和密码

    /* 认证类型 */
    $cfg['服务器'][$i]['auth_type'] = 'http';
    
  2. 在配置文件中设置正确的密码

    $cfg['服务器'][$i]['密码'] = 'myPwd';
    

但都不起作用。

谁能建议一种访问 MySQL 的解决方法?我并不担心无法使用 root 帐户,但想使用其他用户名对数据库进行 CRUD。

After successful setup on initial launch of MySQL, the page prompted me to set up ROOT password for security reasons.

On setting the password, am no longer able to access MySQL. The error is:

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

Looked up on the net and tried the following options in the config.inc.php from the phpmyadmin foler:

  1. Set the authentication to "http" so that it prompts to enter the username and password

    /* Authentication type */
    $cfg['Servers'][$i]['auth_type'] = 'http';
    
  2. Set up the correct password in the config file

    $cfg['Servers'][$i]['password'] = 'myPwd';
    

None of them worked.

Can anyone suggest a workaround to access MySQL? Am not fussed about not being able to use the root account but would like to CRUD on the database using other username.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

樱娆 2024-09-03 08:54:00

这是我的 phpmyadmin config.inc.php 文件:

<?php

$i = 0;
$i++;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

?>

如果 Apache/PHP 与 MySQL 在同一台机器上运行,那么这应该足够了。然后系统将提示您输入用户名和密码。输入 root 和您设置的密码。

here is my phpmyadmin config.inc.php file:

<?php

$i = 0;
$i++;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

?>

That should be enough if Apache/PHP is running on the same machine as MySQL. Then you will be prompted for a username and password. Enter root and the password that you set.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文