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.

Home Page:http://spring.io/guides/gs/accessing-data-mysql/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MySQLSyntaxErrorException: You have an error in your SQL syntax;

nickkulese opened this issue · comments

commented

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?

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

commented

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.

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?