问题描述
**BEGINNESTEDEXCEPTION**java.net.ConnectExceptionMESSAGE:Connectionrefused:connectSTACKTRACE:java.net.ConnectException:Connectionrefused:connectatjava.net.PlainSocketImpl.socketConnect(NativeMethod)atjava.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)atjava.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)atjava.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)atjava.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)atjava.net.Socket.connect(Socket.java:519)atjava.net.Socket.connect(Socket.java:469)atjava.net.Socket.<init>(Socket.java:366)atjava.net.Socket.<init>(Socket.java:180)atcom.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:124)atcom.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:225)atcom.mysql.jdbc.Connection.createNewIO(Connection.java:1783)atcom.mysql.jdbc.Connection.<init>(Connection.java:450)atcom.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:411)atjava.sql.DriverManager.getConnection(DriverManager.java:582)atjava.sql.DriverManager.getConnection(DriverManager.java:207)atcom.tools.JDBConnection.creatConnection(JDBConnection.java:21)atcom.tools.JDBConnection.executeQuery(JDBConnection.java:52)atcom.dao.AdminDao.getAdminPassword(AdminDao.java:21)atcom.webtier.AdminAction.index(AdminAction.java:25)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:597)atcom.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)atcom.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)atcom.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)atcom.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)atcom.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)atcom.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
解决方案
解决方案二:
1,MYSQL服务器的IP地址或者端口设置不正确.2,防火墙设置.
解决方案三:
1.端口可能冲突2.mysql服务可能没有起来,你可以试试在dos里面输入netstartmysql,打开mysql服务