我安装了wamp server2它没有密码,它有这个错误,然后我去了mysql,并使用此命令为root设置密码,我可以使用此密码login,但我再次无法访问phpmyadmin.I重新启动服务。
update user.mysql set password=password('root') where user='root';
然后我去config.inc更改通过这一个:
$cfg['Servers'][$i]['password'] = 'root';
再次我重新启动,再次没有结果。
phpmyadmin页面:
Welcome to phpMyAdmin Error MySQL said: Documentation #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.
config.inc:
<?php /* Servers configuration */ $i = 0; /* Server: localhost [1] */ $i++; $cfg['Servers'][$i]['verbose'] = 'localhost'; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['port'] = ''; $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'] = 'root'; $cfg['Servers'][$i]['password'] = 'root'; $cfg['Servers'][$i]['AllowNoPassword'] = true; /* End of servers configuration */ $cfg['DefaultLang'] = 'en-utf-8'; $cfg['ServerDefault'] = 1; $cfg['UploadDir'] = ''; $cfg['SaveDir'] = ''; /* rajk - for blobstreaming */ $cfg['Servers'][$i]['bs_garbage_threshold'] = 50; $cfg['Servers'][$i]['bs_repository_threshold'] = '32M'; $cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600; $cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M'; ?>
首先是这行$cfg['Servers'][$i]['password'] = ''; 设置允许错误,并重新启动不会改变错误Erika的帮助下我明白,它不能读取confg.inc文件如何使其从该文件中读取?
#1045 - Access denied for user 'root'@'localhost' (using password: NO)
PHPMyAdmin正在尝试无需密码进行身份validation。
您可能需要将下面的内容更改为false :
$cfg['Servers'][$i]['AllowNoPassword'] = true;
安装脚本将configuration文件config.inc.php保存到[phpmyadmindir] / config。 我把它移动到phpmyadmin的根目录,并工作。
在你的config.inc改变
$cfg['Servers'][$i]['host'] = 'localhost'; 至
$cfg['Servers'][$i]['host'] = '127.0.0.1';
或者设置套接字path。 使用TCP连接时,您需要提供IP地址。