![]() ![]() is centered around the database account name having either a dash - or an. I’ve tried to hibernate.globally_quoted_identifiers=true - table name is quted, but not catalog name. DriverManager will ask each registered driver to create a connection with. Hyphens are a big problem because if you end up mapping a column name to a variable, most languages do not like to have hyphens inside variable names. I’ve tried to update hibernate, my-sql drivers to latest version - issue not solved. CREATE DATABASE testDB Tip: Make sure you have admin privilege before creating any database. TO usernamelocalhost Popularity 5/10 Helpfulness 1/10 Language sql. Example: GRANT ALL PRIVILEGES ON database-name. Which ends with Exception: Caused by: .jdbc4.MySQLSynta圎rrorException: 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 '-db.test add column user_id varchar(255)' at line 1Īt 0(Native Method)Īt (NativeConstructorAccessorImpl.java:62)Īt (DelegatingConstructorAccessorImpl.java:45)Īt .newInstance(Constructor.java:423)Īt .handleNewInstance(Util.java:425)Īt .getInstance(Util.java:408)Īt .createSQLException(SQLError.java:943)Īt .checkErrorPacket(MysqlIO.java:3973)Īt .checkErrorPacket(MysqlIO.java:3909)Īt .sendCommand(MysqlIO.java:2527)Īt .sqlQueryDirect(MysqlIO.java:2680)Īt .execSQL(ConnectionImpl.java:2483)Īt .execSQL(ConnectionImpl.java:2441)Īt .executeInternal(StatementImpl.java:845)Īt .execute(StatementImpl.java:745)Īt .ProxyStatement.execute(ProxyStatement.java:95)Īt .HikariProxyStatement.execute(HikariProxyStatement.java)Īt .(GenerationTargetToDatabase.java:54)Īs MySQL requires identifier with dash to be quoted, e.g.: alter table `my-db`.test add column user_id varchar(255) Put database names with hyphen characters (-) in backticks () to execute querries. To support automatic hyphenation by entering a. Using Backticks, Double Quotes, and Single Quotes when querying a MySQL database can be boiled down to two basic points. You can find your own as you are the one who knows about your environment and problem. Generated migration SQL is: alter table my-db.test add column user_id varchar(255) Here you can, among other things, replace a shortcut automatically by a dash, even in another font. mysql -h 127.0.0.1 -u root -p'' -e 'CREATE DATABASE var2 ' mysql -h 127.0.0.1 -u root -p'' 'var2' < '/path of/sql/file' I am not giving you any solution, I am just suggesting you. Public class Test = "id_key", columnDefinition = "VARCHAR(80)") ![]() The name can contain only lowercase letters, numbers, and the hyphen. Preexisting table: create table `my-db`.test (id_key VARCHAR(80) not null, primary key (id_key)) engine=InnoDBĪnd entity has 1 new column user_id: = "test") Create database testdb in the server testsvr with the default parameters. Sample jdbc url I am using: jdbc:mysql://localhost:32793/my-db with Hikari datasource. The issue is can be reproduced with MySQL database (I’ve tested PostgreSQL, H2 - looks like working fine). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |