Hello all!
I am using
Struts 1.1 with MySql 4.0.x.
When MySql is initially installed it has 4 users in the user table:
+-----------+---------+------------------
| Host | User | password
+-----------+---------+------------------
| localhost | root |
| % | root |
| localhost | |
| % | |
+-----------+---------+------------------
The root and the "blank" user have no passwords. The MySql book says it's a good idea to secure these users. So I did by giving them all passwords.
I then added 2 new users and gave them access to a database I will be accessing through Struts 1.1.
Here's my struts-config.xml datasource:
<data-sources>
<data-source>
<set-property property="description"
value="CD Manager sample datasource"/>
<set-property property="autoCommit"
value="false"/>
<set-property property="driverClass"
value="org.gjt.mm.mysql.Driver"/>
<set-property property="maxCount"
value="4"/>
<set-property property="url"
value="jdbc:mysql://localhost/cdsample"/>
<set-property property="user"
value="user01"/>
<set-property property="password"
value="user01pw"/>
</data-source>
</data-sources>
Here's the issue that's coming up:
When I bring up Struts, he's happy and finds no issue with the data-source. But when I issue a SQL, through an Action class on this data source, Struts complains that '@localhost' access is denied. For some reason (and maybe one of you can explain) the sql being submitted is not using the user01/user01pw access but the blank user. When I remove the password from the blank user, my SQL works.
Help!!
Thanks,
Tom Autera