我有一个从别人那里考来的项目,改了数据库连接配置,tomcat发布运行都没错。但是使用的时候会报错:
Struts Problem Report
Struts has detected an unhandled exception: Messages: Access denied for user 'root'@'localhost' (using password: YES)
Could not get JDBC Connection; nested exception is java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
File: com/mysql/jdbc/MysqlIO.java
Line number: 2,975
我的mysql连接配置:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://127.0.0.1:3456/tata?useUnicode=true&characterEncoding=gb2312" />
<property name="username" value="root" />
<property name="password" value="root" />
</bean>密码是正确的,端口也是对的,我改成了3456,我用mysql front登录没有错。另一个项目,连接相同的数据库,也是那样配置不会出错。这是为什么?怎么办?各位大神。
Struts Problem Report
Struts has detected an unhandled exception: Messages: Access denied for user 'root'@'localhost' (using password: YES)
Could not get JDBC Connection; nested exception is java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
File: com/mysql/jdbc/MysqlIO.java
Line number: 2,975
我的mysql连接配置:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://127.0.0.1:3456/tata?useUnicode=true&characterEncoding=gb2312" />
<property name="username" value="root" />
<property name="password" value="root" />
</bean>密码是正确的,端口也是对的,我改成了3456,我用mysql front登录没有错。另一个项目,连接相同的数据库,也是那样配置不会出错。这是为什么?怎么办?各位大神。
解决方案 »
- mysql 做分片后,是怎么处理分布式事务的?
- mysql4.0.25是否支持select * table where not exists ()
- mysql奇怪问题!
- 一个需求sql不太会写
- 在SQL Server数据库中可以用语法execute('select 5*7')得到结果35,在mysql如何运行'select 5*7'字符串呢并得到35的结果集。
- MYSQL 单表两字段合并出错
- SOS!!!我的mysql服务崩溃了。
- [mysqld-5.0.1-alpha-nt]string data,right truncated报错是什么原因引起来的?
- 存储过程的解析问题
- 网络连接断开了,每次mysql_ping() 阻塞20秒左右?
- mysql的root密码忘记,求助
- mysql存储过程if嵌套if的写法
看看有结果吗