Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySql Exception #2

Open
josephraj2k16 opened this issue Aug 7, 2018 · 9 comments
Open

MySql Exception #2

josephraj2k16 opened this issue Aug 7, 2018 · 9 comments

Comments

@josephraj2k16
Copy link

hi,
I followed the code from your blog,and created the same notes app project.After I built the maven project it shows mysql exception like below:

image

In database side I just created a notes_app schema alone and im using mysql workbench.

@callicoder
Copy link
Owner

callicoder commented Aug 7, 2018

Hi,

Can you tell me your Spring Boot version and MySQL version? Also share the mysql-connector-java version if you have specified the version explicitly in the pom.xml file.

@josephraj2k16
Copy link
Author

I have spring boot (v2.0.0.RELEASE) and I haven't specified MySql version explicitly. here is my pom.xml.

`

4.0.0

<groupId>com.example</groupId>
<artifactId>easy-notes</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>

<name>easy-notes</name>
<description>Rest API for a Simple Note Taking Application</description>

<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>2.0.0.RELEASE</version>
	<relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	<java.version>1.8</java.version>
</properties>

<dependencies>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-data-jpa</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-web</artifactId>
	</dependency>

	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-devtools</artifactId>
		<scope>runtime</scope>
	</dependency>
	<dependency>
		<groupId>mysql</groupId>
		<artifactId>mysql-connector-java</artifactId>
		<scope>runtime</scope>
	</dependency>
	
</dependencies>

<build>
	<plugins>
		<plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
		</plugin>
	</plugins>
</build>
`

@josephraj2k16
Copy link
Author

hi,I just downloaded your project and loaded it in eclipse and still the same error persists,Iam using "Clean install spring-boot:run" command as goals while running as maven build in eclipse.

@callicoder
Copy link
Owner

callicoder commented Aug 9, 2018

Hey,

I wanted to know your mysql server version

mysql --version

Also, there is a stackoverflow thread here on this issue. Have you checked that?

@josephraj2k16
Copy link
Author

i have installed mySql through mysql Installer and here is the version
image

@ramazansakin
Copy link

Hi @josephraj2k16 ,

If you have a trouble with mysql and its not important to use mysql, you can test it via H2 db easily

@coding-with-parthasarathi

Hi @josephraj2k16, this exception has also occurred for me while working with a similar CRUD app. MySQL server has lost the connection. You just need to reconfigure MySQL server to avoid the exception.

@ramazansakin
Copy link

Hi @coding-with-parthasarathi and @josephraj2k16 ,
It has been long time ago :D, but if you still interested about the repo or anyone who might interest can check out my repo below.
I also created a PR for related changes.

https://github.com/ramazansakin/spring-boot-mysql-rest-api-tutorial/tree/master

@jguirimm
Copy link

Hi @coding-with-parthasarathi and @josephraj2k16 , It has been long time ago :D, but if you still interested about the repo or anyone who might interest can check out my repo below. I also created a PR for related changes.

https://github.com/ramazansakin/spring-boot-mysql-rest-api-tutorial/tree/master

Hello, I have a proposal to improve exception handling. If you're interested, I'll create a pull request (PR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants