MariaDB错误 errno: 168 "Unknown (generic) error from engine"

用vagrant搭建了一个LNMP环境:

操作系统是centos 7.4
php是 7.1
MariaDB 是10.2.9

当执行laravel的命令php artisan migrate时,mariadb发生错误:


    [root@vagrant-prod production]# php artisan migrate
    
                                                                                                                    
      [Illuminate\Database\QueryException]                                                                          
      SQLSTATE[HY000]: General error: 1005 Can't create table `production`.`migrations` (errno: 168 "Unknown (generic) error from engine") (SQL: create table `migrations` (`id` int unsigned not null auto_increment primary key, `migration` varchar(255) not null, `batch` int not null) default character set utf8mb4 collate utf8mb4_unicode_ci)                                                                                         
                                                                                                                    
    
                                                                                                                    
      [PDOException]                                                                                                
      SQLSTATE[HY000]: General error: 1005 Can't create table `production`.`migrations` (errno: 168 "Unknown (generic) error from engine")                                                                            
                                                                                                                    

错误有时是这样的:


    [root@vagrant-prod production]# php artisan migrate
    
                                                                                                                    
      [Illuminate\Database\QueryException]                                                                          
      SQLSTATE[42S01]: Base table or view already exists: 1050 Table '`production`.`migrations`' already exists (SQL: create table `migrations` (`id` int unsigned not null auto_increment primary key, `migration` varchar(255) not null, `batch` int not null) default character set utf8mb4 collate utf8mb4_unicode_ci)        
                                                                                                                    
    
                                                                                                                    
      [PDOException]                                                                                                
      SQLSTATE[42S01]: Base table or view already exists: 1050 Table '`production`.`migrations`' already exists                                                                                                       
                

什么原因呢?

阅读 9k
1 个回答

"Unknown (generic) error from engine" 未知内部引擎错误,maridb自身原因!

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题