I am getting the following error while connecting to mysql server 4.1 from
tomcat 5.0.3 .Tomcat is running in linux and mysql is in a different windows machine.
The problem is the linux IP '172.19.63.57' is shown in the error message instead of the windows IP which is specified in the datasource of struts-config.xml of tomcat in linux.A part of the datasource is as follows
<data-source type="org.apache.commons.dbcp.BasicDataSource">
<set-property
property="driverClassName"
value="com.mysql.jdbc.Driver" />
<set-property
property="url"
value="jdbc:mysql://172.19.63.199:3306/test?autoReconnect=true" />
<set-property
property="username"
value="root" />
<set-property
property="password"
value="root" />
In the errors below the user is showing as ' ' instead of root.
Server connection failure during transaction. Due to underlying exception: 'java.sql.SQLException: Access denied for user ''@'172.19.63.57' (using password: NO)'.
** BEGIN NESTED EXCEPTION **
java.sql.SQLException
MESSAGE: Access denied for user ''@'172.19.63.57' (using password: NO)
STACKTRACE:
java.sql.SQLException: Access denied for user ''@'172.19.63.57' (using password: NO)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2847)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:750)