可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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
回答1:
I had this problem after changing the password for the root user in phpMyAdmin. I know nothing about programming but I solved it by doing the following:
Go to file C:\wamp\apps\phpmyadmin3.2.0.1\config.inc.php
(I guess you would replace "wamp" with the name of your server if you're not using Wamp Server)
Find the line $cfg['Servers'][$i]['password']=''
and change this to
$cfg['Servers'][$i]['password']='NO'
Try opening phpMyAdmin again, and hopefully the message will now read "Access denied for user 'root'@'localhost' (using password: YES)
Now change the password in the above line to 'yourpassword' (whatever you had set it to before)
Hope this helps somebody.
回答2:
Go to file C:\wamp\apps\phpmyadmin3.2.0.1\config.inc.php
Find the line $cfg['Servers'][$i]['password']='' and change this to
$cfg['Servers'][$i]['password']='root' where root is the name of the password you had set in this instance
Hope this helps somebody.
回答3:
Here's the solution to getting the 1045 Access denied for user 'root'@'localhost' (using password: NO)
in phpMyAdmin.
First here's what happens:
The problem occurs when you change over from using phpMyAdmin with no password and mysql with no root password. You change root in mysql to having a root password. You dutifully change phpMyAdmin's config.ini.php file's $cfg['Servers'][$i]['password']=''
line to include your password and restart everything you can find, but phpMyAdmin still can't get through.
The reason is that your browser still contains cookies for phpMyAdmin and those cookies reflect not needing a password to access mysql.
The solution:
Clear out the cookies relating to phpMyAdmin. Its browser specific, but in my Firefox, its under Tools > Page Info > Cookies.
You might need to relog in with phpMyAdmin or use the signon.php script (under /examples in my WAMP install).
回答4:
Try this:
- Open config.inc.php file in the phpmyadmin directory
- Find line 21: $cfg['Servers'][$i]['password'] = ''
- Change it to: $cfg['Servers'][$i]['password'] = 'your_password';
- Restart XAMPP
reference
回答5:
Try this:
1. xampp/htdocs/xampp/cds.php change line 4 to: mysql_connect("localhost","root","enter password here"); change line 64 to: if(!mysql_connect("localhost","root","enter password here"))
From here
回答6:
Step one: Go to... C:\xampp\phpMyAdmin
Step Two: Open the below file with notePad++
config.inc.php
Step Three: Locate the following information and change the password.
/* Authentication type and info */ $cfg['Servers'][$i]['auth_type'] = 'config'; $cfg['Servers'][$i]['user'] = 'ENTER_YOUR_USER_NAME_HERE'; $cfg['Servers'][$i]['password'] = 'ENTER_YOUR_PASS_HERE'; $cfg['Servers'][$i]['extension'] = 'mysqli'; $cfg['Servers'][$i]['AllowNoPassword'] = true; $cfg['Lang'] = '';
回答7:
My.ini
from the file #password
and #bindaddress
are commented change the password to root and bindaddress= 127.0.0.1
and from the file cds.php
change the
mysql_connect("localhost", "root", ""); to mysql_connect("localhost", "root", "root");
Stop the Mysql services and try login again it got logged in.
回答8:
reset your mysql password on xampp security page. restart your mysql service and then access the phpmyadmin page using your password. i tried it. this is working fine for me.
回答9:
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:
- Go to C:\wamp\apps\phpmyadmin4.1.14 (Your phpmyadmin version# may differ)
- open the file config.inc in a text editor
- find the line: $cfg['Servers'][$i]['host'] = '127.0.0.1';
- change it to $cfg['Servers'][$i]['host'] = 'localhost';
- save the file
- restart all services in wamp
The problem seems to be that someone forgot to make the server and host match in the configuration files.
回答10:
I'm afraid there's a conflict with the port number(80). Make sure you don't run some software like Skype that use the same port 80
回答11:
I think to troubleshoot your problem you should try the following:
- Check whether the MySQL service is running (Control Panel --> services)
- Use a MySQL client like SQLYOG to check whether you are able to connect to MYSQL Server with the username and password you are using in your code.
- Just try a sample php program, which fetches the data from table Ex. http://www.anyexample.com/programming/php/php_mysql_example__display_table_as_html.xml
回答12:
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.
回答13:
Open the config.inc.php
file in the WAMP
phpmyadmin
directory
Change the line ['Servers'][$i]['password'] = ''
to
$cfg['Servers'][$i]['password'] = 'your_mysql_root_password';
Clear browser cookies
Then Restart all services on WAMP
This worked for me.
NB: the password to use has to be the MySQL password.....
回答14:
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';
回答15:
If you are using XAMPP rather than WAMP, the path you go to is:
C:\xampp\phpMyAdmin\config.inc.php
回答16:
On OSX I had same difficult, but a figure out a solu