设为首页收藏本站

简体中文 繁體中文 English 日本語 Deutsch 한국 사람 بالعربية TÜRKÇE português คนไทย Français

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 30|回复: 3

安装laravel

[复制链接]

79

主题

265

回帖

811

积分

高级会员

积分
811
发表于 2020-1-21 11:20:34 | 显示全部楼层 |阅读模式
安装laravel-admin总是提示这个,是什么原因呢。


执行的php artisan admin:install这条命令



错误:
Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table

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

  at D:\phpstudy_pro\WWW\laravel-admin\vendor\laravel\framework\src\Illuminate\Database\Connection.php:669
    665|         // If an exception occurs when attempting to run a query, we'll format the error
    666|         // message to include the bindings with SQL, which will make this exception a
    667|         // lot more helpful to the developer instead of just the database's errors.
    668|         catch (Exception $e) {
  > 669|             throw new QueryException(
    670|                 $query, $this->prepareBindings($bindings), $e
    671|             );
    672|         }
    673|

  Exception trace:

  1   Doctrine\DBAL\Driver\PDOException:

"SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes")
      D:\phpstudy_pro\WWW\laravel-admin\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOStatement.php:123

  2   PDOException:

"SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes")
      D:\phpstudy_pro\WWW\laravel-admin\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOStatement.php:121

  Please use the argument -v to see more details.
回复

使用道具 举报

3

主题

59

回帖

169

积分

注册会员

积分
169
发表于 2020-1-21 11:31:16 | 显示全部楼层
mysql 版本低于5.7 MyISAM表的主键最大是1000字节,升级mysql
回复

使用道具 举报

206

主题

1954

回帖

4686

积分

论坛元老

积分
4686
发表于 2020-1-21 11:31:41 | 显示全部楼层


安装页面上面不是写着解决办法吗
https://github.com/z-song/laravel-admin/issues/1541
回复

使用道具 举报

79

主题

265

回帖

811

积分

高级会员

积分
811
 楼主| 发表于 2020-1-21 12:12:01 | 显示全部楼层

king51 发表于 2020-1-21 11:31

安装页面上面不是写着解决办法吗
https://github.com/z-song/laravel-admin/issues/1541 ...

已解决。非常感谢!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Discuz! X

GMT+8, 2026-3-31 14:38 , Processed in 0.024011 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表