NetBeans连接mysql出错,但在服务的数据库连接下可以
java.lang.ClassNotFoundException:com.mysql.jdbc.Driveratjava.net.URLClassLoader$1.run...
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at textinsert.TextInsert.main(TextInsert.java:12)
java.lang.NullPointerException
at textinsert.TextInsert.main(TextInsert.java:24)
成功生成(总时间:1 秒) 展开
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at textinsert.TextInsert.main(TextInsert.java:12)
java.lang.NullPointerException
at textinsert.TextInsert.main(TextInsert.java:24)
成功生成(总时间:1 秒) 展开
展开全部
连接语句
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost:3306/test?user=root&password=mysql";
conn = DriverManager.getConnection(url);
现错误:
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO)
啊
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost:3306/test?user=root&password=mysql";
conn = DriverManager.getConnection(url);
现错误:
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO)
啊
追问
??? 你的密码不对
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |