当前位置:Gxlcms > PHP教程 > Laravel5.2Zizaco/entrust无法生存数据库

Laravel5.2Zizaco/entrust无法生存数据库

时间:2021-07-01 10:21:17 帮助过:4人阅读

Laravel Framework version 5.2.31 按照Github上的说明,一步步配置的,到执行php artisan migrate 时会报错:

[Illuminate\Database\QueryException]                                         
  SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table nam  
  e '' (SQL: alter table `role_user` add constraint `role_user_user_id_foreig  
  n` foreign key (`user_id`) references `` (`id`) on delete cascade on update  
   cascade)
   
   
   [PDOException]                                                               
  SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table nam  
  e ''
  
  

查看数据库中的表,只创建了roles和role_user两个表!

回复内容:

Laravel Framework version 5.2.31 按照Github上的说明,一步步配置的,到执行php artisan migrate 时会报错:

[Illuminate\Database\QueryException]                                         
  SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table nam  
  e '' (SQL: alter table `role_user` add constraint `role_user_user_id_foreig  
  n` foreign key (`user_id`) references `` (`id`) on delete cascade on update  
   cascade)
   
   
   [PDOException]                                                               
  SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table nam  
  e ''
  
  

查看数据库中的表,只创建了roles和role_user两个表!

看这里

人气教程排行