向用户拒绝更改命令

时间:2015-07-16 16:38:45

标签: spring-boot mariadb

我运行spring boot并尝试生成数据库,我有访问问题

创建数据库但不创建外键

所以我完成了:

GRANT ALL ON *.* TO  'dbuser@localhost';
flush privileges;`

启动spring boot应用程序,但是有关alter den to dbuser

的错误
ALTER command denied to user 'dbuser'@'localhost' for table 'room_payment'
2015-07-16 12:04:28.099 ERROR 4550 --- [           main] org.hibernate.tool.hbm2ddl.SchemaUpdate  : HHH000388: Unsuccessful: alter table vehicle add constraint FK_2k13lq037sx9358mhlf9gfmsc foreign key (model_modelId) references model (model_id)
2015-07-16 12:04:28.100 ERROR 4550 --- [           main] org.hibernate.tool.hbm2ddl.SchemaUpdate  : ALTER command denied to user 'dbuser'@'localhost' for table 'vehicle'
2015-07-16 12:04:28.102  INFO 4550 --- [           main] org.hibernate.tool.hbm2ddl.SchemaUpdate  : HHH000232: Schema update complete

1 个答案:

答案 0 :(得分:2)

错误的引用:

GRANT ALL ON *.* TO  'dbuser@localhost';
                     ^----------------^

由于引用了整个内容,这只是一个用户名。你想要

GRANT ALL ON *.* TO  'dbuser'@'localhost';
                            ^-^

代替。请注意额外的报价。