spring-guides / gs-accessing-data-mysql

Accessing data with MySQL :: Learn how to set up and manage user accounts on MySQL and how to configure Spring Boot to connect to it at runtime.
http://spring.io/guides/gs/accessing-data-mysql/
Apache License 2.0
201 stars 314 forks source link

MySQLSyntaxErrorException: You have an error in your SQL syntax; #19

Closed nickkulese closed 1 year ago

nickkulese commented 5 years ago

Can not run it :(
Getting error: MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '??' at line 1

I'm doing the same as it's written in ReadMe. Using MySQL 8.0.15

What could be wrong here?

dsyer commented 5 years ago

You might need to be a little bit more explicit with your description of what you did.

nickkulese commented 5 years ago

Alright, so I executed these commands in mysql:

mysql> create database db_example; -- Create the new database mysql> create user 'springuser'@'%' identified by 'ThePassword'; -- Creates the user mysql> grant all on db_example.* to 'springuser'@'%'; -- Gives all the privileges to the new user on the newly created database

Then just tried to run the complete one, using ItelliJ Idea.

dsyer commented 5 years ago

So what went wrong where? What did you do when you “tried to run the complete one?” Was there a stack trace with that exception or an error message?