0

I am currently being denied access with the following error:

INSERT command denied to user 'root'@'172.25.0.3' for table 'users' 
ERROR 40 --- Servlet.service() for servlet [dispatcherServlet] in context with 
path [] threw exception [Request processing failed;

nested exception is 
org.springframework.dao.InvalidDataAccessResourceUsageException: 
could not execute statement; SQL [n/a];

nested exception is org.hibernate.exception.SQLGrammarException: 
could not execute statement] with root cause 
java.sql.SQLSyntaxErrorException: INSERT command denied to user 
'root'@'172.25.0.3' for table 'users'

This was all working fine with my last change being adding a column into the table. This worked fine for a while but then broke, since it was the last change I've reverted it but I still have an issue yet it all works as expected on local host (even with the new changes).

I would appreciate any help on this. I am sure the syntax is correct and so would love any suggestions of potential avenues to explore.

NB - My browser just shows a 500 error.

*EDIT - I am able to reproduce the error whenever I add columns to my table (adding or deleting rows appears to be fine). The issue will work on the immediate posting and then shortly after it will start causing the issue. My guess is that the generated statements used by java spring don't get updated whilst the old volume is still there, if that is true then my new question is how I would get the correct queries firing without wiping my volume. Still don't have a solution other then wiping the volume - I will be launching to production shortly so this won't be a viable solution once this happens.

Hj123
  • 41
  • 4

1 Answers1

0

The issue was solved by running docker compose -v - explanation can be seen here - MYSQL_ROOT_PASSWORD is set but getting "Access denied for user 'root'@'localhost' (using password: YES)" in docker container - It unfortunately meant losing my data - this was fine for my usecase but backup your volume before hand.

Hj123
  • 41
  • 4
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 06 '22 at 13:11