MySQL: access denied for user: (Using password: YES) June 30, 2005
Posted by javafoo in javanotes, jdbc, mysql.trackback
More experimenting with struts. So I got ambitious, downloaded MySQL and tried to wire a database into my simple struts app. Setting up MySQL was a breeze, although it was my first time, except that some time was wasted googling for user account creation etc.
So, I set up a datasource in Tomcat, which could be looked up by JNDI. I added this in server.xml.
But was getting errors with Context.lookup, indicating there was no “java:comp/env/jdbc” in the Context. Realized I forgot to add the resource-ref in my web descriptor.
This done, I was getting a different error.
Access denied for user ‘blah’: (Using password: YES).
What the …, I didn’t set the password as YES, what the heck was going on?
So googled again (one of these days, when someone asks me what tools, IDE I use for development, I will be sure to add ‘Google’ in there, in fact this should come integrated with the IDE, any Exception or Error message should be linked to Google search), anyway I digress.
So this seems to be a common problem. I tweak the user account a bit in MySQL, apparently the host shouldn’t be set as ‘%’, you are better off setting it to ‘localhost’. I also deleted the default user account ”, which is an empty string. So either of these fixed it for me and I am on my way.
Since I am seeing a lot of searches to this post and one of the commentors (Tyler) rightfully indicates that: The “YES” doesn’t mean that you are using the password “Yes” it simply means “Yes” you are using a password. If the password was blank it would have said “No”
That’s what I thought the issue was to start with (that somehow the password was set to ‘Yes’) or atleast that’s what the MySQL message led me to believe, but later when I tweaked the User Account to set the host, I realized what it was trying to tell me.
Thanks for helping out!
It would be cool if you said HOW to tweak the user account
Please Email me at MRSHarff@gmail.com
Thank you for this. I was about to give up on my phpbb3 install. I’m sure you figured this out by now Bale but you use something like phpMyAdmin to access it.
The “YES” doesn’t mean that you are using the password “Yes” it simply mean “Yes” you are using a password. If the password was blank it might say “No”
what?
francisco.good@hotmail.com
The problem is the host shouldn’t be ‘%’.
Set it to ‘localhost’. Problem solved.
How do you set the host to local host?
Wow thanks so much for posting this. I’ve been banging my head for about an hour to get this working. I have no idea why using % does not allow localhost, but after changing it to be ‘localhost’, I’m able to connect.
And for those asking *how* to change it, I did it by connecting to the ‘mysql’ database and then running:
update user set Host=’localhost’ where User=’myUserName’
[…] via the command line client and via ColdFusion. Finally after some googling I came across this blog post suggesting to change the privilege details to allow connecting from ‘localhost’ instead […]
What should you set the host to if you want it to connect from any external IP, and not limit it to just one permitted IP?
Pls I’m experiencing a serious sql problem… i changed the mysql password then did some changes then afterwards the site would nt open, it keeps saying…..
Access denied for user ‘v_root’@’cgi0603.int.bizland.net’ (using password: YES) even when i changed the password to blank… pls help!
change usernape to debian-sys-maint /etc/mysql/debian.cnf
but before that start ur mysql with:mysql -u debian-sys-maint -p
Your major failing Gaxton
Your usernaame your entering is wrong
Its a vroot error
is it configuration problem or permission issue?
On a new installation of MySQL, phpMySQL shows under privileges there is a denial of access for ‘any user’ on % for usage privileges. This seems to stop any user matching. Delete these and users can access if they have only specific database access, or create a user that does not match exactly eg on localhost, then they can access. Reason ?
hell
I had the same problem, fixed it in a few minutes by placing the installation folder back to the website via ftp, the reinstalled it with the new passwords etc and now its fine again. You shouldn’t lose any of the information you stored previously because you don’t get rid of it in the FTP client, all you do is add your installation folder and presto! Email me on tony@excsell.co.uk if you’re still stuck and I’ll try n help the best I can.
Try this, might do the trick. It will changes your password to something else.
GRANT USAGE ON *.* TO user@host IDENTIFIED BY ‘password’;
Where,
user = username you are trying to connect with.
host = It depends but usually its ‘localhost’
password = the new password you want to set.
Once the new password is set, restart your mysql server and try connecting.
Good Luck
Abhay
i dont understand, where i have to write %? can u make a example? or write the code?
I was getting errors like:
root@desktop:~# mysql -u root
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)
One very good solution worked for me is, just use this command and follow the Instructions:
root@desktop:~# /usr/bin/mysql_secure_installation
Thank you guys for help. My problem is fixed.
Lol! thanks for this post … I appropriately found it on with google
Well, im having difficulty now connecting to a remote website’s database (one where i set up the mysql database online using the tool supplied to me)
Access denied for user ‘USERNAME’@” (using password: YES)
any comments / fixes i should know about? I substituted my username there that I actually used, for my own safety
Goo solution for us es really amazing tutorial thanks a lot
MANY MANY THANKS for this fix – I have searched around for HOURS trying to fix this and just came accross your poats – THANKS !!!!!, Dave ( http://WWW.CAI.ORG )
The solution proposed in this article is good only if you want to connect ONLY to localhost.
If you want to have a runtime configurable host you want to set, for your user, ANY host, so you have to keep ‘%’ in the textbox for host.
What resolved for me was to reset the password for this user. I’ve changed it to ‘abc’ then I’ve changed it again to the desired one and that’s all !
Success !
of all the stupid (&^&()*. I’ve been fighting this problem for 2 hours and the problem was the stupid password generated by my web host version of myPHPADMIN. Their password generator apparently generates passwords that cause problems with my local version of MySQL. So I generated a local password and problem solved. Thanks for the tip on trying a password of ABC. As soon as i saw that work, I knew what the problem was.
Access denied for user ‘tujeng’@’localhost’ (using password: YES) in C:\xampp\htdocs
pls help …? thanks
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘”use mysql;”,”delete from user where User=’root’;”and “flush privieges;”‘ at line 1
Hmmm…This still doesn’t fix my problems, i am trying to isntall some open source script on my server and can’t install it because i got
Mysql Error: Access denied for user ‘ (using password: YES) ..what you say how to fix it? I didn’t find any answer ? thanks
I still don’t understand the correction.
I already use localhost to my Database Host, but still get the error, how to fix this ?
I solved my issue my creating the database (wordpress) using mysql command prompt then select use existing database on the wordpress installation screen instead of the option to create the database.
Its simple and worked for me as in comment 15 Tony said.
What I did in Control Panel
1) -> delete the database
-> create a new database
2) -> delete the user
-> create new user with new password.
Now try, it will work
Thanks
praveen kirsur
What database did you delete?
I have uploaded a website on live domain, it was running good on previous server but when i uploaded the website on new server it says “Access denied for user ‘fast_fs’@’localhost’ (using password: YES)”
I went to MySQL database and created the User fast_fs and add this user with checking all the privileges. But still it showing the same message Access denied for user ‘fast_fs’@’localhost’ (using password: YES)
I will appreciate help for this. asimjamalpk@hotmail.com
Asim
I am rarely motivated by statistics articles but this report just gave a great deal of authentic and invaluable information that I just have to acknowledge it. I am well-aware of all the importance of this information and salute you with a sincere thanks for your insight.
Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘ncos’@’localhost’ (using password: YES) in C:\wamp\www\ncos\config\connection.php on line 2
Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in C:\wamp\www\ncos\config\connection.php on line 3
Warning: mysql_query() [function.mysql-query]: Access denied for user ‘SYSTEM’@’localhost’ (using password: NO) in C:\wamp\www\ncos\header.php on line 4
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\wamp\www\ncos\header.php on line 4
Access denied for user ‘SYSTEM’@’localhost’ (using password: NO)
could any one help me for this problem
I have had made my desktop application on C#.net with backend mysql. As on the localhost, it was working all good for the connection and database too. But, I am facing problem, while working the database mysql server (online)…While connecting my project application with the online database server mysql. Here, I had attached the code and screenshot of error.
try
{
string vHost = “harihan.com”;
string vPort = “3306”;
string vUser = “harihan_usrpcs”;
string vPass = “pcs789”;
string vDb = “harihan_pcs”;
connectionstr = string.Format(“Data Source={0};Database={1};User Id={2};Password={3};Port={4}”, vHost, vDb, vUser, vPass, vPort);
Application.Run(new PCS());
}
catch (Exception e)
{
Application.Exit();
}
While running the application, the below error is giving at the stage of open connection of database.
Access denied for user ‘harihan_usrpcs’@’122.169.90.38’ (using password: YES)
Any Help will be highly appreciatated. Thanks in advance
Best game ever
Even myself having same error message “Access denied for user ‘orangehrm’@’localhost’ (using password: YES). Please Check Privileged Database Username and Password Correct. ” on initial configuration
OMG i love u man… u r so cool lol!! it worked yeah!!!!!!!!!!!!!!!!!!! es
thanks a lot bro.
WTF didn’t work !!!!
Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘mysql16.000webho’@’localhost’ (using password: YES) in /home/a7506188/public_html/install/include/database.php on line 33
Free Web Hosting
Access denied for user ‘mysql16.000webho’@’localhost’ (using password: YES)
thee same damned prob !! 😦
Access denied for user ‘kannur02_bts1’@’localhost’ (using password: YES)
[…] 还有一个比较特别的地方,在这里记录一下。(using password: YES) 表示你在登录的时候使用了密码。而不是登录user需要使用密码。所以该文章解决的困惑是,为什么我设置了空密码。还提示错误说要使用密码呢。其实不是,只是你在常识用密码登录而已。 […]
I have a same error of Priya
thankyou this information helped me a lot and I could successfully establish the connection
I usually do not drop a leave a response, however after reading through a few of the comments on this page MySQL:
access denied for user: (Using password: YES) | Wake up and smell
the java. I do have a couple of questions for you if it’s okay. Is it simply me or does it appear like some of these remarks appear like they are left by brain dead folks? 😛 And, if you are writing at additional social sites, I’d like to follow you.
Could you list of every one of your social community
sites like your twitter feed, Facebook page or linkedin profile?
I wasted over an hour with the same problem. Deleting the “guest” account resolved it for me.
Their rarity has historically made fancy colored diamonds very highly prized in contrast to colorless crystals normally linked to these gemstones.
So, get fashionable with an owner of a style that is unique and can make you appearance and feel your
best. At the final major one I attended in Geneva the jewelry was
being guarded by men with guns.
Highly descriptive post, I loved that a lot. Will there be a part
2?
The sign that the intelli-clean does not work is that
when you press the intelli-clean button on the
handle, there is no difference if it is on or off, it does not
change suction. You will find yourself picking up dirt you never imagined was around, and which
you would not be capable of getting out with
many other vacuum cleaners. This brush could be air driven or could be electric and plug into an electric
outlet by the hose outlet.
Link to database cannot be established: SQLSTATE[28000] [1045] Access denied for user ‘root’@’localhost’ (using password: YES)
please help me
Whoa, incredible blog format! How long have you been blogging for?
Your website is great, and content materials are remarkable!
Shemale erotic
http://shemale.erolove.in/?private.tyler
shemaler transexaul sex hardcore transexual sexy pics freeshemaleporn.com
I like the valuable info you supply on your articles.
I’ll bookmark your blog and take a look at once more right here frequently.
I’m somewhat sure I will be told a lot of new stuff proper right here!
Good luck for the following!
تجميل وزراعة وتقويم الاسنان,تجميل الاسنان,تبييض الاسنان,تقويم الاسنان,زراعة الاسنان,تركيبات الاسنان,جراحة الفكين,الخلع الجراحي,عدسات الاسنان,متخصصين واستشاريين,
https://www.facebook.com/dentalimplantegypt
You need to take part in a contest for one of the most useful websites on the net.
I’m going to recommend this site!
It’s very simple to find out any topic on web as compared to textbooks,
ass I found this paragraph at this site.
Before you soon will understand even when you will end up necessitated to help you schedule
a discussion meeting, you could hold on to one thing
inside your. Not all of the health professionals are identical.
Inside the, website different clinical doctors to whom work wart moving.
All these clinical practitioners virtually all have the ability to
managed and in addition get the job done her operation throughout in any case all of
them see fit. In essence, it indicates that even though your new neighbor ended up being necessitated that will schedule a consulting dialogue together with his also his / her primary care provider, the situation carries out not invariably signify that you will definitely be essential.
After two days of searching I found your blog and all I had to change was the host from % to localhost. THANK YOU!!!
Hi there! Someone in my Mysplace grouup sharedd this website with us so I came to give it
a look. I’m definitely loving the information. I’m book-marking and will bee tweeting
this to my followers! Outstanding blog aand superb
design and style.
I simply want to input that you have a good website and I enjoy the design and also artcles in it.
Thanks to my father who told me about this weblog, this weblog is actually amazing.
[…] MySQL: access denied for user: (Using password: YES … – Jun 30, 2005 · MySQL: access denied for user: (Using password: YES) June 30, 2005 Posted by javafoo in javanotes, jdbc, mysql. trackback. More experimenting with struts. […]
hfg