ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 에러 java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
    Database/mysql 2019. 1. 17. 02:22


    |글의 목적

    Eclipse에서 Mysql을 이용하는 프로젝트를 하는 과정에 데이터베이스 관련 오류 발생하여 기록함



    |환경

    1. Eclipse oxygen

    2. jdk 1.9

    3. mysql 5.7



    |오류내용

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



    |문제원인

    정확한 원인 파악x

    아마도 프로젝트 및 톰캣 클린이 제대로 되지않아서 그런걸로 판단



    |해결책

    1. 프로젝트 새로고침(F5), 프로젝트 클린(Clean), 톰캣 클린(Clean)

    2. 새로운 계정 생성 및 권한 변경



    |오류 전체문구

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

    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3978)

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:871)

    at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1714)

    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1224)

    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2199)

    at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2230)

    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2025)

    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:778)

    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)

    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

    at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)

    at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)

    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)

    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)

    at java.sql/java.sql.DriverManager.getConnection(Unknown Source)

    at java.sql/java.sql.DriverManager.getConnection(Unknown Source)

    at user.UserDAO.<init>(UserDAO.java:22)

    at org.apache.jsp.loginAction_jsp._jspService(loginAction_jsp.java:141)

    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)

    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476)

    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)

    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)

    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)

    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)

    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)

    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)

    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

    at java.base/java.lang.Thread.run(Unknown Source)

    java.lang.NullPointerException

    at user.UserDAO.login(UserDAO.java:34)

    at org.apache.jsp.loginAction_jsp._jspService(loginAction_jsp.java:142)

    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)

    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476)

    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)

    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)

    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)

    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)

    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)

    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)

    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

    at java.base/java.lang.Thread.run(Unknown Source)


    댓글

© 2018 T-Story. All right reserved.