tag:blogger.com,1999:blog-13911304.post-1120142967408103912005-06-30T07:35:00.000-07:002005-06-30T07:49:27.413-07:00MySQL: access denied for user: (Using password: YES)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.<br />So, I set up a datasource in Tomcat, which could be looked up by JNDI. I added this in server.xml.<br />But was getting errors with Context.lookup, indicating there was no <span style="color: rgb(0, 0, 153);">"java:comp/env/jdbc"</span> in the Context. Realized I forgot to add the resource-ref in my web descriptor.<br />This done, I was getting a different error.<br /><span style="color: rgb(102, 51, 51); font-weight: bold;">Access denied for user 'blah': (Using password: YES).</span><br />What the ..., I didn't set the password as YES, what the heck was going on?<br />So googled again <span style="color: rgb(153, 153, 0);">(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)</span>, anyway I digress.<br />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.Java Foohttp://www.blogger.com/profile/14104080800348407575noreply@blogger.com