请问用JavaWebStudio怎样连接MYSQL数据库,按照教程不行啊,特别是连接池的配置。
现把我的web.xml贴出
<servlet>
<servlet-name> dbInit </servlet-name>
<servlet-class> javawebstudio.struts_db.DBInitServlet </servlet-class>
<init-param>
<param-name> driverClass </param-name>
<param-value> org.gjt.mm.mysql.Driver </param-value>
</init-param>
<init-param>
<param-name> jdbcURL </param-name>
<param-value> <![CDATA[jdbc:mysql://localhost:3306/StrutsBBS?useUnicode=true&characterEncoding=GBK]]> </param-value>
</init-param>
<init-param>
<param-name> minCount </param-name>
<param-value> 1 </param-value>
</init-param>
<init-param>
<param-name> maxCount </param-name>
<param-value> 10 </param-value>
</init-param>
<load-on-startup> 1 </load-on-startup>
<init-param>
<param-name> user </param-name>
<param-value> root </param-value>
</init-param>
<init-param>
<param-name> password </param-name>
<param-value> a </param-value>
</init-param>
</servlet>
tomcat的错误是:
access denied to user 'root '@ 'locahost '(using password;no)
是配置里面有错误吗?
------解决方案--------------------
access denied to user 'root '@ 'locahost '(using password;no)没有输入密码嘛,你看错误很明白嘛。访问被拒绝,using password;no(用户密码没有),把密码添上
------解决方案--------------------
access denied to user 'root ' password '你自己定义 '@ 'locahost '
------解决方案--------------------
我记得默认用户root好像没密码吧,如果有的话也不是 'a '吧