Home > Back-end >  when table name include a DOT , JPA throw "INSERT command denied to user for table 'XXX�
when table name include a DOT , JPA throw "INSERT command denied to user for table 'XXX�

Time:01-03

I have a strange issue with JPA. I have renamed a table in my database from "Users" to "App.Users". And put this annotation to my entity class: @Table(name="App.Users") then I got this error:

INSERT command denied to user 'XXXXX'@'XXXXX' for table 'Users'

I am using MariaDB.

CodePudding user response:

Please read the chapter Identifier names of MariaDB documentation.

Identifiers with characters which are not ANSI characters in the range [0-9,a-z,A-Z$_] and which are not unicode characters >= 0x0080FF have to be quoted in backticks.

The decimal point in unquoted identifiers additionally has a special meaning: In your example it means schema/database "App" and table "Users". Since the user has no privileges on database App (event if it doesn't exist) a privilege error occurred.

  • Related