Search Posts

MariaDB error in LNMP: `errno: 168 "Unknown (generic) error from engine"`

I am using vagrant LNMP environment.

OS is centos 7.4
php is 7.1
MariaDB is 10.2.9

There is an error when I run laravel command php artisan migrate,as follow:

[[email protected] production]# php artisan migrate


  [IlluminateDatabaseQueryException]                                                                          
  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")                                                                            

or the error is like this:

[[email protected] production]# php artisan migrate


  [IlluminateDatabaseQueryException]                                                                          
  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                                                                                                       

why is it?

Source: Stackoverflow MariaDB

1 comment on MariaDB error in LNMP: `errno: 168 "Unknown (generic) error from engine"`

Leave a Reply

Your email address will not be published. Required fields are marked *