我已经尝试遵循此http://www.ishaanrawat.com/solved-wampserver-1045-access-denied-for-user-rootlocalhost-using-password-no/指示,但我收到了相同的错误。
几分钟前,我卸载了wamp server,希望重新安装后可以正常使用我的wamp server,但仍然出现了相同的错误。
以下是错误信息:
MySQL 说:文档
您可以观看以下视频以解决您的问题:
http://www.youtube.com/watch?v=BgcW4h6ZAro&t=7m21s
p/s:这是越南视频 :)
在config.inc.php
文件中,您需要编辑以下代码:
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
//uncomment this
$cfg['Servers'][$i]['auth_type'] = 'cookie';
//comment this
//$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
进入XAMPP或WAMPS服务器中的phpMyAdmin文件夹,打开config.inc.php文件。将用户名和密码更改为您在数据库中设置的内容。
/* 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'] = '';
这对我很有用。在安装WAMP之前,我已经在我的电脑中安装了MySQL。打开MySQL命令行客户端所需的密码是“pw”。现在,在安装WAMP之后,当我试图打开phpMyAdmin时,它会给出与您相同的错误。如何解决:
找到以下几行:
$cfg ['Servers'] [$i] ['user'] ='root';
$cfg ['Servers'] [$i] ['password'] ='';
/ *服务器参数 /
$cfg ['Servers'] [$i] ['host'] ='127.0.0.1';
$cfg ['Servers'] [$i] ['connect_type'] ='tcp';
$cfg ['Servers'] [$i] ['compress'] = false;
/ 如果您的服务器没有mysqli,则选择mysql*/
$cfg ['Servers'] [$i] ['extension'] ='mysqli';
$cfg ['Servers'] [$i] ['AllowNoPassword'] = true;
将“ $cfg [ 'Servers'] [$i] ['AllowNoPassword'] = true;
”更改为“ $cfg [ 'Servers'] [$i] ['AllowNoPassword'] = false;
”。
将“ $cfg ['Servers'] [$i] ['password'] =''
”更改为“ $cfg ['Servers'] [$i] ['password'] ='pw'
”。(请记住用您的密码替换 'pw
')。
重新启动WAMP中的所有服务,然后再次尝试打开phpMyAdmin。
首先在config.inc.php文件中把"AllowNoPassword"的值更改为false。 然后为root设置密码,最后登录phpMyAdmin。
解决方案是:
首先备份所有项目和数据库。
从您的系统(Ubuntu 16.04)中卸载 lampp
。
重新安装 lampp
。
打开 phpmyadmin
。错误仍未被解决。
打开 phpmyadmin
文件夹下的 config.inc.php
。
更改以下行:
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'your password';
现在保存文件(如果无法保存,则写入):
sudo -H gedit /opt/lampp/phpmyadmin/config.inc.php
重新启动您的 xampp
服务器。
再次转到 localhost/phpmyadmin
。尝试使用用户名 root
登录,并将密码字段留空。如果这不起作用,请使用您输入的密码登录。
祝你好运!
$cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = 'root';
使用默认的mySQL密码'root',这对我起作用了!!
手动删除xampp并安装mysql、phpmyadmin、php5和apache2。
sudo su
apt-get install mysql-server mysql-client
apt-get install apache2
apt-get install php5 libapache2-mod-php5
apt-cache search php5
根据需要选择并像这样安装:
apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
apt-get install phpmyadmin
service apache2 restart
http://127.0.0.1/phpmyadmin/
这些命令将创建您的xampp服务器。它将快速解决您的问题并且运行非常平稳。 感谢相关文章: