laravel 5.6.12 php artisan使用php 7.2迁移错误

时间:2018-03-23 07:45:30

标签: laravel-5.6

我正在使用laravel laravel 5.6.12和php 7.2。 当我运行php artisan migrate时,我收到此错误。

创建了默认表用户和迁移,但它不会创建我的自定义表管理员。

我认为laravel还不能很好地支持php 7.2。

   Migration table created successfully.

   Illuminate\Database\QueryException  : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique`users_email_unique`(`email`))

   at E:\Folder\Folder\pm-system\pm-app\vendor\laravel\framework\src\Illuminate\Database\Connection.php: 664

   660| // If an exception occurs when attempting to run a query, we'll format the error
   661| // message to include the bindings with SQL, which will make this exception a
662| // lot more helpful to the developer instead of just the database's errors.
663|         catch (Exception $e) {
664|             throw new QueryException(
665|                 $query, $this->prepareBindings($bindings), $e
666|             );
667|         }
668|

   Exception trace:

   1 PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length
   is 767 bytes")
  E:\Folder\Folder\pm-system\pm-app\vendor\laravel\framework\src\Illuminate\Database\Connection.php : 458

   2 PDOStatement::execute()
  E:\Folder\Folder\pm-system\pm-app\vendor\laravel\framework\src\Illuminate\Database\Connection.php : 458

   Please use the argument -v to see more details.

0 个答案:

没有答案