Luk*_*uke 64 php mysql wamp phpmyadmin
我在PC上使用WAMP Server 2.2.在phpMyAdmin(版本5.5.24)中,我编辑了"root"用户(使用"localhost"主机)并为其指定了"root"密码.这是我试图恢复的一个大错误.现在,当我转到localhost/phpmyadmin /我在左边获取数据库菜单,但主框架有一个错误,内容如下:
#1045 - Access denied for user 'root'@'localhost' (using password: NO)
phpMyAdmin tried to connect to the MySQL server, and the server rejected the
connection. You should check the host, username and password in your
configuration and make sure that they correspond to the information given
by the administrator of the MySQL server.
Run Code Online (Sandbox Code Playgroud)
如果我去127.0.0.1/phpmyadmin,我没有得到错误,一切正常.
我尝试将用户密码更改回无密码; 我尝试修改config.inc.php文件以添加新密码(但这使得phpMyAdmin完全错误输出); 我尝试删除并重新创建root/localhost用户.似乎没什么用.root/localhost用户似乎没有密码和所有权限,但错误仍然存在.
任何想法或如何让这个用户的访问恢复正常,而无需重新安装WAMP?
Nik*_*l G 79
在此文件内查找config.inc文件C:\wamp\apps\phpmyadmin3.5.1找到这一行
$cfg['Servers'][$i]['password'] =";
Run Code Online (Sandbox Code Playgroud)
并替换它
$cfg['Servers'][$i]['password'] = 'Type your root password here';
Run Code Online (Sandbox Code Playgroud)
小智 23
在我更改了数据库中的密码后,我遇到了同样的问题.我所做的是编辑了我之前更改过的更新密码,我没有在config.inc.php中更新,并且在D下用相同的用户名:\XAMP\phpMyAdmin的\ config.inc
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = **'root'**;
$cfg['Servers'][$i]['password'] = **'epufhy**';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
Run Code Online (Sandbox Code Playgroud)
小智 14
在phpMyAdmin页面中更改了我的"root"的密码之后,我遇到了同样的问题,并且还从互联网上寻找解决方案,但未能得到我需要的答案,所以我查看了phpMyAdmin目录中的文档.
转到并编辑该文件
\modules\phpmyadmin414x140123114237\config.sample.inc.php
Run Code Online (Sandbox Code Playgroud)
寻找线
$cfg['Servers'][$i]['auth_type'] = 'config'
Run Code Online (Sandbox Code Playgroud)
并将'config'更改为'http',这将允许您在使用浏览器转到phpMyAdmin页面时键入用户名和密码.
要么
请参阅相同的phpMyAdmin目录(phpmyadmin414x140123114237\doc\html)下的文档文件以获取帮助和搜索$cfg['Servers'][$i]['auth_type'],您将看到有关如何登录phpMyAdmin页面的4个选项.
对我有用的:
转到 config.inc.php。
改变
$cfg['Servers'][$i]['AllowNoPassword'] = true;
Run Code Online (Sandbox Code Playgroud)
到
$cfg['Servers'][$i]['AllowNoPassword'] = false;
Run Code Online (Sandbox Code Playgroud)
改变
$cfg['Servers'][$i]['password'] = '';
Run Code Online (Sandbox Code Playgroud)
到
$cfg['Servers'][$i]['password'] = ' ';
Run Code Online (Sandbox Code Playgroud)
改变
$cfg['Servers'][$i]['auth_type'] = 'config';
Run Code Online (Sandbox Code Playgroud)
到
$cfg['Servers'][$i]['auth_type'] = 'http';
Run Code Online (Sandbox Code Playgroud)
重新加载页面 http://localhost/phpmyadmin
类型:根
通道:(空)
现在您可以访问它了。:)
小智 6
嗯..这对我来说似乎很奇怪,但它突然起作用了!
我所做的正是:
突然间它起作用了!
在C:\ xampp \ phpMyAdmin下找到config.inc.php文件,然后在任何编辑器中打开它。找到以下行:
$cfg['Servers'][$i]['password'] = ' ';
Run Code Online (Sandbox Code Playgroud)
在引号内输入所选密码。另外,为了使localhost / phpmyadmin要求输入用户名和密码,请找到以下行:
$cfg['Servers'][$i]['auth_type'] = 'config';
Run Code Online (Sandbox Code Playgroud)
将上面的行更改为:
$cfg['Servers'][$i]['auth_type'] = 'cookie';
Run Code Online (Sandbox Code Playgroud)
小智 5
如果您有 mysql 的现有密码,请按如下所述写:
在C:\wamp\apps\phpmyadmin3.5.1下找到 config(dot)inc 文件在这个文件里面找到这一行
$cfg['Servers'][$i]['password'] =";
并将其替换为
$cfg['Servers'][$i]['password'] = **'your-password'**;
@Dagon 的想法是正确的,但细节上有点欠缺。
如果您使用该访问权限127.0.0.1/phpmyadmin并仔细查看 MySQL 中设置的用户,您应该会看到 3 个版本的root用户名。
这是因为在 MySQL 中,每个用户 ID 都与一个主机关联,即允许用户登录的 PC(IP 地址)。因此,您的 3 个“root”用户 ID 实际上是相同的用户 ID,允许从 3 个单独的主机登录。通常开箱即用的“root”有 3 个主机设置:127.0.0.1、localhost 和 ::1
这些都是 :-
localhost 是从 HOSTS 文件创建的本机的别名 ( c:\windows\system32\drivers\etc\hosts )
127.0.0.1 是本机的 IPv4 环回 IP 地址
::1 是本机的 IPv6 环回 IP 地址
您可能会遇到的情况是,您为 root@127.0.0.1 设置了密码,但没有为其他任何人设置密码。现在您的浏览器将“任意”决定使用::1或127.0.0.1作为主机IP,因此当它使用::1时您的登录将失败。
因此,使用登录127.0.0.1/phpmyadmin并将所有 3 个“root”用户名更改为具有相同的密码,您应该不会再看到此问题。
另请确保您的 HOSTS 文件包含这 2 个条目
127.0.0.1 localhost
::1 localhost
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
343317 次 |
| 最近记录: |