MySQL said: Documentation #1045 - Access denied fo

2019-01-13 13:10发布

i install xampp,but when i try to run it i got error said that like this :

Error

MySQL said: Documentation

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

Connection for controluser as defined in your configuration failed. 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.

i try search in internet for solution, but i still can't fix my problem. I already check whether i used password or not in config.inc.php file. but i do not have use any password. and when i try put password, i still can't solve this problem.

i hope anyone can help me. .thank you

20条回答
We Are One
2楼-- · 2019-01-13 13:38
  1. Open the config.inc.php file in the WAMP phpmyadmin directory

  2. Change the line ['Servers'][$i]['password'] = '' to

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

  3. Clear browser cookies

  4. Then Restart all services on WAMP

This worked for me.

NB: the password to use has to be the MySQL password.....

查看更多
一夜七次
3楼-- · 2019-01-13 13:39

1045 - Access denied for user 'root'@'localhost' (using password: NO) solution: Step 1: Open Location of you wamp/xampp Step 2: Go to phpmyadmin Step 3: Open config.inc.php Step 4: Change the password to the password set for the MySql server and not anything else in this: $cfg['Servers'][$i]['password'] = '' Step 5: Restart all services /restart wamp/xampp.

查看更多
爷的心禁止访问
4楼-- · 2019-01-13 13:42

I had this problem with a fresh install of wamp and using only default settings without setting any passwords. I found an incorrect default setting and I solved it by the following steps:

  1. Go to C:\wamp\apps\phpmyadmin4.1.14 (Your phpmyadmin version# may differ)
  2. open the file config.inc in a text editor
  3. find the line: $cfg['Servers'][$i]['host'] = '127.0.0.1';
  4. change it to $cfg['Servers'][$i]['host'] = 'localhost';
  5. save the file
  6. restart all services in wamp

The problem seems to be that someone forgot to make the server and host match in the configuration files.

查看更多
做个烂人
5楼-- · 2019-01-13 13:43

I had this same problem after I dropped the special PhpMyAdmin controluser account from MySQL.

I had to update the config.inc.php file and replace the entries for 'controluser' and controlpass' with 'user' and 'password'.

So my file ended like this:

$cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password']='123456';

查看更多
smile是对你的礼貌
6楼-- · 2019-01-13 13:46

If you are using XAMPP rather than WAMP, the path you go to is:

C:\xampp\phpMyAdmin\config.inc.php
查看更多
甜甜的少女心
7楼-- · 2019-01-13 13:47

Try this:

  1. Open config.inc.php file in the phpmyadmin directory
  2. Find line 21: $cfg['Servers'][$i]['password'] = ''
  3. Change it to: $cfg['Servers'][$i]['password'] = 'your_password';
  4. Restart XAMPP

reference

查看更多
登录 后发表回答