laravel-admin php artisan admin:install报错问题解决办法
问题描述:根据laravel-admin官方文档安装步骤,执行:php artisan admin:install 安装时报错:
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
usersadd uniqueusers_email_unique(
问题原因:laravel-admin1.6要求mysql数据库版本^5.7以上。
解决办法:将以下文件中的
vendor\laravel\framework\src\Illuminate\Database\Schema\Builder.php
public static $defaultStringLength = 255;
修改为:250以下
public static $defaultStringLength = 250;
需要删除数据库migrations、users表。
重新执行:
php artisan admin:install
安装成功:
$ php artisan admin:install
Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_000000_create_users_table
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated: 2014_10_12_100000_create_password_resets_table
Migrating: 2016_01_04_173148_create_admin_tables
Migrated: 2016_01_04_173148_create_admin_tables
Database seeding completed successfully.
Admin directory was created: \app\Admin
HomeController file was created: \app\Admin/Controllers/HomeController.php
AuthController file was created: \app\Admin/Controllers/AuthController.php
ExampleController file was created: \app\Admin/Controllers/ExampleController.php
Bootstrap file was created: \app\Admin/bootstrap.php
Routes file was created: \app\Admin/routes.php
启动服务后,在浏览器打开 http://localhost/admin/ ,使用用户名 admin 和密码 admin登陆.
- Laravel 出现"RuntimeException inEncrypter.php line 43: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths."问题的解决办法
- 关于thinkphp应用配置config.php无法加载的问题解决办法
- laravel post TokenMismatchException in VerifyCsrfToken.php line 53 问题解决方法
- [置顶] centos7源码装apache,mysql,php及各种问题的解决办法
- 关于php中验证码显示不出来的问题解决办法
- PHP facebook Graph API以及Twitter twitteroauth 发投稿换行问题解决办法
- CentOs下安装Php的过程记录以及发现的问题和解决办法
- php fsockopen中多线程问题的解决办法[翻译]
- PHP_关于php时间戳最大支持到2038年问题解决办法
- Android 出现问题Installation error: INSTALL_FAILED_CONFLICTING_PROVIDER解决办法
- CentOS下make menuconfig出现install ncurses的问题解决办法
- PHP之Laravel框架使用问题汇总与解决方式
- 新版Android源码用mmm编译 apk 优化,导致Failure [INSTALL_FAILED_DEXOPT]问题的解决办法
- PHP中SESSION不能跨页传递问题的解决办法
- 抛开cookie使用session-PHP中SESSION不能跨页传递问题的解决办法
- php artisan migrate : [PDOException] could not find driver解决办法
- PHP 极光推送 ios-dev 问题解决办法
- PHP中in_array函数使用的问题与解决办法
- php5.5.15注释问题PHP Deprecated: Comments starting with '#' are deprecated in *.ini 警告解决办法
- PHP源码安装经常会碰到的问题及解决办法