0
MySQL
에 로컬로 연결된 Spring Boot
응용 프로그램이 있습니다. 내 RaspberryPi
서버에 업로드 파일 jar
을 생성했습니다. jar
파일이 successfuly 생성 한 있지만 내 서버에 배포 한 후 응용 프로그램을 실행하려고했을 때 :서버에 배포 된 SpringBoot 응용 프로그램이 DB와 연결하고 싶지 않습니다.
아래에 쓰여지는 것을 볼 수 있지만 그것을 실행할 때 문제를 처리하는 방법을 궁금하네요. Intellij
로컬로 올바르게 시작됩니까?
질문에 그렇습니다. 서버에 MySQL
을 설치했습니다.
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_65]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_65]
Caused by: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964) ~[mysql-connector-java-5.1.40.jar!/:5.1.40]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970) ~[mysql-connector-java-5.1.40.jar!/:5.1.40]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906) ~[mysql-connector-java-5.1.40.jar!/:5.1.40]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:873) ~[mysql-connector-java-5.1.40.jar!/:5.1.40]
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1710) ~[mysql-connector-java-5.1.40.jar!/:5.1.40]
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226) ~[mysql-connector-java-5.1.40.jar!/:5.1.40]
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2253) ~[mysql-connector-java-5.1.40.jar!/:5.1.40]
at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2104) ~[mysql-connector-java-5.1.40.jar!/:5.1.40]
... 58 common frames omitted
2017-05-08 17:45:21.543 WARN 29145 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
UPDATE : - application.properties
# LOCAL DATABASE
spring.datasource.url = jdbc:mysql://localhost:3306/test3?autoReconnect=true&useSSL=false
spring.datasource.username = root
spring.datasource.password = admin
# REMOTE DATABASE
#spring.datasource.url = jdbc:mysql://localhost:9090/test3
//in fact the address to the remote db is modraszka.sth.sth:8080
#spring.datasource.username = root
#spring.datasource.password = password
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
나는 'application.properties'로 게시물을 업데이트했습니다. – bielas