jdbc / mysql连接问题 [英] jdbc/mysql connection problem

查看:72
本文介绍了jdbc / mysql连接问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我来自印度。我是Java.Presentlly的新手我正在研究我需要使用mysql的项目。

我已经设置了同样的开发环境。我也安装了mmsql jdbc驱动程序。

i我正在使用apache-tomcat-jsp-mysql。

但是当我运行一个servlet包括mysql db它给出了错误,例如

"访问被拒绝用户''root'''''localhost''(使用密码:YES)"

i试过了很多方法可以解决这个问题,但没有完成。

你能帮助我解决这个问题。

hi!
I am from india .I am new to Java.Presentlly i am working on project in which i need to use mysql.
I had set up an development env.for the same .I had installed mmsql jdbc driver also.
i am using apache-tomcat-jsp-mysql.
but when i ran an servlet which includes mysql db it gives error like
"Access denied for user ''root''@''localhost'' (using password: YES)"
i had tried so many way to resolve this but not done.
Will u help me 2 come out of this problem.

推荐答案


嗨!

我来自印度。我是Java.Presentlly的新手我正在研究我需要使用mysql的项目。

我已经设置了一个开发环境。我也安装了mmsql jdbc驱动程序。

i我正在使用apache-tomcat-jsp-mysql。

但当我跑一个包含mysql db的servlet,它给出了错误li ke

访问被拒绝用户''root'''''localhost''(使用密码:YES)"

i尝试了很多方法来解决这个问题但是没有完成。

你能帮助我解决这个问题。
hi!
I am from india .I am new to Java.Presentlly i am working on project in which i need to use mysql.
I had set up an development env.for the same .I had installed mmsql jdbc driver also.
i am using apache-tomcat-jsp-mysql.
but when i ran an servlet which includes mysql db it gives error like
"Access denied for user ''root''@''localhost'' (using password: YES)"
i had tried so many way to resolve this but not done.
Will u help me 2 come out of this problem.



很可能你的root密码错了。

你是否可以使用

从控制台连接mysql -uroot -p?

Most probably your password for root is wrong.
Are you able to connect from the console using
mysql -uroot -p ?


是的,我只是这样使用。

但是当我从浏览器运行servlet时,我的日志/ catalina中出现了错误.out。
yes,i am using that way only.
But when i ran servlet from browser i get that error in my logs/catalina.out .


当我通过consol时我可以使用数据库。
when i go through consol i could use database.


这篇关于jdbc / mysql连接问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆