{"action":"published","release":{"url":"https://api.github.com/repos/790013438/SpringDeveloper/releases/10164284","assets_url":"https://api.github.com/repos/790013438/SpringDeveloper/releases/10164284/assets","upload_url":"https://uploads.github.com/repos/790013438/SpringDeveloper/releases/10164284/assets{?name,label}","html_url":"https://github.com/790013438/SpringDeveloper/releases/tag/SpringBoot-MySQL%E9%85%8D%E7%BD%AE","id":10164284,"tag_name":"SpringBoot-MySQL配置","target_commitish":"master","name":"Spring Boot 使用MySQL需要的配置","draft":false,"author":{"login":"790013438","id":21995328,"avatar_url":"https://avatars1.githubusercontent.com/u/21995328?v=4","gravatar_id":"","url":"https://api.github.com/users/790013438","html_url":"https://github.com/790013438","followers_url":"https://api.github.com/users/790013438/followers","following_url":"https://api.github.com/users/790013438/following{/other_user}","gists_url":"https://api.github.com/users/790013438/gists{/gist_id}","starred_url":"https://api.github.com/users/790013438/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/790013438/subscriptions","organizations_url":"https://api.github.com/users/790013438/orgs","repos_url":"https://api.github.com/users/790013438/repos","events_url":"https://api.github.com/users/790013438/events{/privacy}","received_events_url":"https://api.github.com/users/790013438/received_events","type":"User","site_admin":false},"prerelease":true,"created_at":"2018-03-19T06:52:23Z","published_at":"2018-03-20T04:24:44Z","assets":[],"tarball_url":"https://api.github.com/repos/790013438/SpringDeveloper/tarball/SpringBoot-MySQL配置","zipball_url":"https://api.github.com/repos/790013438/SpringDeveloper/zipball/SpringBoot-MySQL配置","body":"```pom.xml\r\n        <dependency>\r\n            <groupId>org.springframework.boot</groupId>\r\n            <artifactId>spring-boot-starter-data-jpa</artifactId>\r\n        </dependency>\r\n        <dependency>\r\n            <groupId>org.springframework.boot</groupId>\r\n            <artifactId>spring-boot-starter-data-rest</artifactId>\r\n        </dependency>\r\n        <!-- MYSQL -->\r\n        <dependency>\r\n            <groupId>mysql</groupId>\r\n            <artifactId>mysql-connector-java</artifactId>\r\n        </dependency\r\n```\r\n```application.properties\r\n# Set here configurations for the database connection\r\n\r\n# MySQL: Connection url for the database \"journal\"\r\nspring.datasource.url = jdbc:mysql://localhost:3306/journal\r\n\r\n# MySQL: Username and password\r\nspring.datasource.username = springboot\r\nspring.datasource.password = springboot\r\n\r\n# Keep the connection alive if idle for a long time (needed in production)\r\nspring.datasource.testWhileIdle = true\r\nspring.datasource.validationQuery = SELECT 1\r\n\r\n# ===============================\r\n# = JPA / HIBERNATE\r\n# ===============================\r\n\r\n# Use spring.jpa.properties.* for Hibernate native properties (the prefix is\r\n# stripped before adding them to the entity manager).\r\n\r\n# Show or not log for each sql query\r\nspring.jpa.show-sql = true\r\n\r\n# Hibernate ddl auto (create, create-drop, update): with \"update\" the database\r\n# schema will be automatically updated accordingly to java entities found in\r\n# the project\r\nspring.jpa.hibernate.ddl-auto = create-drop\r\n\r\n# Naming strategy\r\nspring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy\r\n\r\n# Allows Hibernate to generate SQL optimized for a particular DBMS\r\nspring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect\r\n\r\n\r\n\r\n# ===============================\r\n# = Data - Rest\r\n# ===============================\r\nspring.data.rest.basePath=/api\r\n```\r\n数据导入，Spring Boot 2.0.0，将sql语句放在\r\n/src/main/resources/import.sql"}}
{"actor":{"display_login":"790013438"}}