首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

jdbc连mysql有关问题

2012-03-13 
jdbc连mysql问题D:\Application\MySQL\binmysql -u root -p123456Welcome to the MySQL monitor.Commands

jdbc连mysql问题
D:\Application\MySQL\bin>mysql -u root -p123456
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 27
Server version: 5.0.67-community-nt MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

可见用户root,密码123456正常

Java code
String url="jdbc:mysql://127.0.0.1/lb?user=root&password=123456";            conn = DriverManager.getConnection(url);

抛出异常:
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

[解决办法]
呦~URL还可以这样写!
[解决办法]
up
[解决办法]


[解决办法]
Java code
[color=#FF0000]//修改一下 [/color]String url="jdbc:mysql://localhost/lb?user=root&password=123456";
[解决办法]
同意楼上,换成3个参数的那个,要是还不行的话也有可能是驱动版本的问题

热点排行