用户的phpMyAdmin访问被拒绝';根'@';本地主机';(使用密码:否)
我无法在xampp中连接到我的MySQL我有以下错误: MySQL说:文档 1045-拒绝用户“root”@“localhost”的访问(使用密码:否) mysqli_real_connect():(HY000/1045):用户“root”@“localhost”的访问被拒绝(使用密码:否) phpMyAdmin试图连接到MySQL服务器,但服务器拒绝了连接。您应该检查配置中的主机、用户名和密码,并确保它们与MySQL服务器管理员提供的信息相对应 CONFIG.INC.PHP文件用户的phpMyAdmin访问被拒绝';根'@';本地主机';(使用密码:否),phpmyadmin,xampp,Phpmyadmin,Xampp,我无法在xampp中连接到我的MySQL我有以下错误: MySQL说:文档 1045-拒绝用户“root”@“localhost”的访问(使用密码:否) mysqli_real_connect():(HY000/1045):用户“root”@“localhost”的访问被拒绝(使用密码:否) phpMyAdmin试图连接到MySQL服务器,但服务器拒绝了连接。您应该检查配置中的主机、用户名和密码,并确保它们与MySQL服务器管理员提供的信息相对应 CONFIG.INC.PHP文件 <?ph
<?php
/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */
/*
* Servers configuration
*/
$i = 0;
/*
* First server
*/
$i++;
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';
/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
/*
* End of servers configuration
*/
找到了一个解决方案,在我的配置文件中我刚刚更改了
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['auth_type'] = 'config';
到
到
编辑文件xampp/mysql/bin/my.ini
加
在[mysqld]
下,您需要修改config db.php
并将您的密码设置为您给用户root
的密码,否则,如果用户没有密码,请按此'
执行消息要求的操作,创建用户pma@localhost在没有密码的phpMyAdmin面板中,执行以下步骤-
1.转到config.inc.php文件并查找-
$cfg['Servers'][$i]['auth\u type']
2.将$cfg['Servers'][$i]['auth_type']的值更改为'cookie'或'http'
3.查找$cfg['Servers'][$i]['AllowNoPassword']并将其值更改为true
现在,无论何时您想要登录,输入root作为您的用户名,跳过密码并继续按提交按钮
注意-如果您选择身份验证类型作为cookie,那么无论何时关闭浏览器并重新打开它,您都必须再次登录。@guzuer
更改
$cfg['Servers'][$i]['user'] = 'groot';
$cfg['Servers'][$i]['password']='groot';
在您的~/xampp/phpMyAdmin/config.inc.php
这里我的用户名是groot,密码是groot
在撰写此答案时,我遇到了这个问题,我通过查找您的问题解决了这个问题。如果上述解决方案都不适用于您,只需进行以下更改即可。
改变这个
$cfg['Servers'][$i]['host'] = '127.0.0.1';
到
及
到
它适用于我的情况,也可能适用于您的情况。这是不同的解决方案,请检查您的服务是否正常运行,如果WAMP图标显示为橙色,并且三分之二的服务正在运行,则此解决方案将起作用。
根本原因:
如果在您的系统中有mysql,那么稍后您安装了WAMP,然后再次安装一个mysql作为WAMP包,mysql的默认端口是3306,因此在两个mysql中,端口都是3306,这是一个端口冲突,所以只需更改端口即可。更改端口的步骤
右键单击WAMP图标
选择工具
在MySql部分使用的端口中更改端口
这也解决了我的问题。它只是自动登录。转到XAMPP->mysql->bin->my.ini
使用编辑器打开文件,并在mysql之后添加“跳过授权表”。您可能为用户“root”设置了不同的密码,或者更改了密码。我犯了与以下相同的错误:
mysqli_real_connect():(HY000/1045):用户“root”@“localhost”的访问被拒绝(使用密码:是)
我发现我的phpmyAdmin根密码在“mysql”和“phpmyAdmin”数据库上都不相同,所以我更新了与“mysql”数据库相同的“phpmyAdmin”数据库密码,如下所示:
sudo gedit/etc/phpmyadmin/config db.php
并更新字段
$dbuser='root'
$dbpass='myNewPassword' 默认情况下,在计算机中安装WAMPP时,PhpMyAdmin的密码为空。
所以,将root放在user部分,并将password字段留空。
希望它能起作用
快乐编码 检查/etc/phpmyadmin/config db.php文件
到终点站
运行vi/etc/phpmyadmin/config db.php
核对资料
按Ctrl+X组合键
尝试使用配置文件中的信息通过web再次登录到phpmyadmin
请运行并重新配置您的phpmyadmin
sudo dpkg重新配置phpmyadmin
我以前也遇到过这种情况:
转到windows的路径
C:\xampp\phpMyAdmin\
转到linux的路径:
/etc/phpmyadmin/
找到的文件名为:
config.inc.php
打开文件
更改此项:
['password'] = ''
致:
此默认值
如果您从控制面板更改密码,它可能是任何密码,这非常危险:“当使用此参数启动MySQL时,它完全避免在连接和查询时检查其授权表。这意味着任何人都可以从任何位置登录,并在数据库上执行任何操作。”稍后,您可以使用mysql查询来实现这一点,然后使用skip来实现快速解决方法DownVote:这样做不好。您应该重置根密码(搜索stackoverflow,上面有大量帖子)或创建适当的用户,授予te适当的权限并配置您config.inc.php请使用代码格式,例如在代码格式中添加config-db.php作为config db.php
。对值执行相同的操作,例如'root'
和'
。如果您可以复制粘贴文件的一部分以及位置,这将非常有用。请确保在粘贴时删除您的私人信息,如凭据。就是这样。谢谢:)谢谢节省了我的时间这对我很有用。为什么我们应该选择HTTP而不是配置?你是一个救世主。我的问题的答案是修复授予特权的用户信息,而不是@Farhikhteh告诉我的“root”。这解决了我的问题!出于某种奇怪的原因,默认设置的用户名和密码在安装时没有被覆盖,转到config-db.php文件导致了我的问题!你救了我!HTTP登录打开弹出窗口,但登录不正确
skip-grant-tables
$cfg['Servers'][$i]['user'] = 'groot';
$cfg['Servers'][$i]['password']='groot';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$I]['auth_type'] ='cookies';
$cfg['Servers'][$i]['auth_type'] = 'HTTP';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '1234';
['password'] = ''
['password'] = 'root'