codingXiaxw / CustomerManagement

a simple customer management system using MVC model with development ducumentation :bowtie:
http://codingxiaxw.cn
1.39k stars 710 forks source link

c3p0数据库连接池连接不了MySQL,什么原因呢 #11

Open wangwoods opened 7 years ago

wangwoods commented 7 years ago

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)..... jdbc连上MySQL了,应该不是MySQL和root密码的问题

wudouxingjun commented 6 years ago

我也是同样的问题,正在找解决方法

jackzhengpinwen commented 6 years ago

我可以正常运行饿

lihanxiang commented 6 years ago

表的名称不对吧

pengest commented 6 years ago

注意database的名称,和的名称。 c3p0-config.xml<property name="jdbcUrl">jdbc:mysql://localhost:3306/customer</property> 以上customer是database的名称。

lihanxiang commented 6 years ago

报错的原因是,没有连接上数据库,你需要输入自己的数据库名称

499704069 commented 6 years ago

终端可以连接MySQL,可以使用customer数据库,但是运行项目添加客户还是出现java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)问题,这是什么原因?

codingXiaxw commented 6 years ago

项目中的数据库配置文件jdbc.properties是否配置正确呢?

在 2018年9月27日,上午11:06,master Po notifications@github.com 写道:

终端可以连接MySQL,可以使用customer数据库,但是运行项目添加客户还是出现java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)问题,这是什么原因?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/codingXiaxw/CustomerManagement/issues/11#issuecomment-424943490, or mute the thread https://github.com/notifications/unsubscribe-auth/AQfn7H6ZPJN5l5gB-G16FTfJB9Rf9xK3ks5ufECvgaJpZM4QMZuJ.

499704069 commented 6 years ago

我把jdbc:mysql://localhost:3306/customer中的localhost改为127.0.0.1就可以了,有啥区别吗?

codingXiaxw commented 6 years ago

没区别,你是改了本地的hosts文件吗

在 2018年9月27日,上午11:16,master Po notifications@github.com 写道:

我把jdbc:mysql://localhost:3306/customer中的localhost改为127.0.0.1就可以了,有啥区别吗?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/codingXiaxw/CustomerManagement/issues/11#issuecomment-424945142, or mute the thread https://github.com/notifications/unsubscribe-auth/AQfn7Gg86ylqR6JeLquLaB1svE3mmDtxks5ufELxgaJpZM4QMZuJ.