Comments (24)
该错误是因为 MySQL 版本低于 5.7,在低版本的 MySQL 中可能出现该问题,现在已修复,更新下代码 再试试 php artisan migrate
。
如果还有问题的话试试下面两个方案(二选一)
- 在
.env
文件中添加配置项DB_CHARSET=utf8
和DB_COLLATION=utf8_unicode_ci
,添加之后再执行php artisan migrate
命令(缺点是这样就不支持Emoji了) - 升级MySQL到 5.7
from wizard.
5.5.60-MariaDB 这边是mariadb,不知道是否也支持,我先试试升级看看
from wizard.
10.3.14-MariaDB 中提示不支持数据库引擎“ARCHIVE”,但其实默认engine是 innodb,报错时候error也没有对应记录,难道是maridb太新的原因?
# php artisan migrate
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: 2017_07_31_012730_create_project_table
Migrated: 2017_07_31_012730_create_project_table
Migrating: 2017_07_31_013758_create_page_table
Migrated: 2017_07_31_013758_create_page_table
Migrating: 2017_08_01_151100_create_page_history_table
Migrated: 2017_08_01_151100_create_page_history_table
Migrating: 2017_08_03_232417_create_operation_logs_table
In Connection.php line 664:
SQLSTATE[42000]: Syntax error or access violation: 1286 Unknown storage engine 'ARCHIVE' (SQL: create table wz_operation_logs
(id
int unsigned not null auto_increment primary key, user_id
int unsigned null comment '操作用户ID', message
varchar(
255) null comment '日志消息内容', context
text null comment '记录日志时候的上下文信息', created_at
timestamp not null comm
ent '创建时间') default character set utf8mb4 collate 'utf8mb4_unicode_ci' engine = ARCHIVE)
In PDOConnection.php line 63:
SQLSTATE[42000]: Syntax error or access violation: 1286 Unknown storage engine 'ARCHIVE'
In PDOConnection.php line 61:
SQLSTATE[42000]: Syntax error or access violation: 1286 Unknown storage engine 'ARCHIVE'
# php artisan migrate:status
+------+----------------------------------------------------+-------+
| Ran? | Migration | Batch |
+------+----------------------------------------------------+-------+
| Yes | 2014_10_12_000000_create_users_table | 1 |
| Yes | 2014_10_12_100000_create_password_resets_table | 1 |
| Yes | 2017_07_31_012730_create_project_table | 1 |
| Yes | 2017_07_31_013758_create_page_table | 1 |
| Yes | 2017_08_01_151100_create_page_history_table | 1 |
| No | 2017_08_03_232417_create_operation_logs_table | |
| No | 2017_08_04_143640_create_template_table | |
| No | 2017_08_06_115558_create_group_table | |
| No | 2017_08_06_120713_create_user_group_ref_table | |
| No | 2017_08_06_122310_update_user_table | |
| No | 2017_08_06_124106_create_project_group_ref_table | |
| No | 2017_08_10_093939_create_categories_table | |
| No | 2017_08_11_171545_create_share_table | |
| No | 2017_08_17_224954_create_comments_table | |
| No | 2017_08_18_133716_create_attachments_table | |
| No | 2017_08_19_002350_create_notifications_table | |
| No | 2017_09_19_174315_modify_operation_logs | |
| No | 2017_09_24_145801_modify_user_table | |
| No | 2018_01_27_150601_modify_project_table | |
| No | 2018_04_11_172516_create_project_catalogs_table | |
| No | 2018_04_11_172816_modify_project_add_catalog | |
| No | 2018_04_12_143655_create_project_star_table | |
| No | 2018_05_10_105015_create_tags_table | |
| No | 2018_05_10_105629_create_page_tag_table | |
| No | 2018_12_11_164112_add_sort_to_nav | |
| No | 2018_12_11_164721_add_sort_to_nav_history | |
| No | 2019_04_20_141850_add_sync_to_pages | |
| No | 2019_04_20_141934_add_sync_filed_to_page_histories | |
| No | 2019_04_27_214733_add_objectguid_column | |
+------+----------------------------------------------------+-------+
from wizard.
OK,了解了,操作日志存储用到了 ARCHIVE 存储引擎,Mariadb 10.0 版本之后默认是没有安装这个存储引擎的
The ARCHIVE storage engine was installed by default until MariaDB 10.0. In MariaDB 10.1 and later, the storage engine's plugin will have to be installed.
所以解决方案有下面这两种(推荐第一种)
-
最简单的方式时在Mariadb中安装这个插件,只需要连接到Mariadb之后执行
INSTALL SONAME 'ha_archive';
命令就可以了,不需要 重启数据库 -
第二种办法时不安装 ARCHIVE 存储引擎,修改
$WIZARD_HOME/database/migrations/2017_08_03_232417_create_operation_logs_table.php
文件的第 17 行,将$table->engine = 'ARCHIVE';
注释掉Schema::create('wz_operation_logs', function (Blueprint $table) { -$table->engine = 'ARCHIVE'; +// $table->engine = 'ARCHIVE'; $table->increments('id');
参考
from wizard.
按照法一执行后没问题了(INSTALL SONAME 'ha_archive';),不过发现跟demo画风有点差异呀!
from wizard.
注册管理员账号时候也有问题
Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Class 'DOMDocument' not found
from wizard.
那个是debug模式,在 .env 中修改一下下面两个配置
APP_DEBUG=false
APP_ENV=production
第二个问题是因为php环境需要安装 xml 扩展(php-xml)。这样 php安装xml扩展。
可能是我之前觉得这些扩展都是默认安装的,我再更新下文档。
from wizard.
非常感谢! Debug模式修改正常,但由于之前注册账号使用了邮箱,现在再次注册会提示已经存在,如何清除已注册邮箱信息呢?注册用admin命名会有如下500的server error
from wizard.
如果是刚安装好,还没有开始使用的话,可以直接执行SQL
TRUNCATE wz_users
清空用户表就可以重新注册了,至于为什么会报错500,这个能麻烦提供一下错误日志(默认为storage/logs/laravel.log)不?
from wizard.
log如下,请参考。
laravel.log
from wizard.
是因为php环境需要安装 xml 扩展(php-xml)。参考这里 php安装xml扩展。
- OpenSSL PHP Extension
- PDO PHP Extension
- Mbstring PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension
- Ctype PHP Extension
- JSON PHP Extension
- BCMath PHP Extension
- LDAP PHP Extension
执行 php -m
命令应该可以看到这些已经安装的扩展
from wizard.
from wizard.
这可真的把我难到了,不符合常理啊,再执行下 php --re dom | grep class
命令,把输出发出来看看
$ php --re dom | grep class
Class [ <internal:dom> final class DOMException extends Exception implements Throwable ] {
Class [ <internal:dom> class DOMStringList ] {
Class [ <internal:dom> class DOMNameList ] {
Class [ <internal:dom> class DOMImplementationList ] {
Class [ <internal:dom> class DOMImplementationSource ] {
Class [ <internal:dom> class DOMImplementation ] {
Class [ <internal:dom> class DOMNode ] {
Class [ <internal:dom> class DOMNameSpaceNode ] {
Class [ <internal:dom> class DOMDocumentFragment extends DOMNode ] {
Class [ <internal:dom> class DOMDocument extends DOMNode ] {
Class [ <internal:dom> <iterateable> class DOMNodeList implements Traversable, Countable ] {
Class [ <internal:dom> <iterateable> class DOMNamedNodeMap implements Traversable, Countable ] {
Class [ <internal:dom> class DOMCharacterData extends DOMNode ] {
Class [ <internal:dom> class DOMAttr extends DOMNode ] {
Class [ <internal:dom> class DOMElement extends DOMNode ] {
Class [ <internal:dom> class DOMText extends DOMCharacterData ] {
Class [ <internal:dom> class DOMComment extends DOMCharacterData ] {
Class [ <internal:dom> class DOMTypeinfo ] {
Class [ <internal:dom> class DOMUserDataHandler ] {
Class [ <internal:dom> class DOMDomError ] {
Class [ <internal:dom> class DOMErrorHandler ] {
Class [ <internal:dom> class DOMLocator ] {
Class [ <internal:dom> class DOMConfiguration ] {
Class [ <internal:dom> class DOMCdataSection extends DOMText ] {
Class [ <internal:dom> class DOMDocumentType extends DOMNode ] {
Class [ <internal:dom> class DOMNotation extends DOMNode ] {
Class [ <internal:dom> class DOMEntity extends DOMNode ] {
Class [ <internal:dom> class DOMEntityReference extends DOMNode ] {
Class [ <internal:dom> class DOMProcessingInstruction extends DOMNode ] {
Class [ <internal:dom> class DOMStringExtend ] {
Class [ <internal:dom> class DOMXPath ] {
这是我这边的输出,可以看到,里面有一个 DOMDocument
。
from wizard.
我也满腹疑窦呢,多探讨
php --re dom | grep class
Class [ <internal:dom> final class DOMException extends Exception implements Throwable ] {
Class [ <internal:dom> class DOMStringList ] {
Class [ <internal:dom> class DOMNameList ] {
Class [ <internal:dom> class DOMImplementationList ] {
Class [ <internal:dom> class DOMImplementationSource ] {
Class [ <internal:dom> class DOMImplementation ] {
Class [ <internal:dom> class DOMNode ] {
Class [ <internal:dom> class DOMNameSpaceNode ] {
Class [ <internal:dom> class DOMDocumentFragment extends DOMNode ] {
Class [ <internal:dom> class DOMDocument extends DOMNode ] {
Class [ <internal:dom> <iterateable> class DOMNodeList implements Traversable, Countable ] {
Class [ <internal:dom> <iterateable> class DOMNamedNodeMap implements Traversable, Countable ] {
Class [ <internal:dom> class DOMCharacterData extends DOMNode ] {
Class [ <internal:dom> class DOMAttr extends DOMNode ] {
Class [ <internal:dom> class DOMElement extends DOMNode ] {
Class [ <internal:dom> class DOMText extends DOMCharacterData ] {
Class [ <internal:dom> class DOMComment extends DOMCharacterData ] {
Class [ <internal:dom> class DOMTypeinfo ] {
Class [ <internal:dom> class DOMUserDataHandler ] {
Class [ <internal:dom> class DOMDomError ] {
Class [ <internal:dom> class DOMErrorHandler ] {
Class [ <internal:dom> class DOMLocator ] {
Class [ <internal:dom> class DOMConfiguration ] {
Class [ <internal:dom> class DOMCdataSection extends DOMText ] {
Class [ <internal:dom> class DOMDocumentType extends DOMNode ] {
Class [ <internal:dom> class DOMNotation extends DOMNode ] {
Class [ <internal:dom> class DOMEntity extends DOMNode ] {
Class [ <internal:dom> class DOMEntityReference extends DOMNode ] {
Class [ <internal:dom> class DOMProcessingInstruction extends DOMNode ] {
Class [ <internal:dom> class DOMStringExtend ] {
Class [ <internal:dom> class DOMXPath ] {
from wizard.
这样看来环境也没啥问题了,那就确认一下这几点
- 安装扩展之后,php-fpm是否重启了?
- 应用的nginx配置中,指定的php环境是否和执行命令行时用的是同一个环境?
from wizard.
php-fpm重启过,系统也重启过,php-fpm、mariadb、nginx都是同一台机器,不知道啥情况了呢
from wizard.
这样看来环境也没啥问题了,那就确认一下这几点
- 安装扩展之后,php-fpm是否重启了?
- 应用的nginx配置中,指定的php环境是否和执行命令行时用的是同一个环境?
能否在数据库直接创建管理账号,然后测试看看登录以及用户管理?
from wizard.
可以的,你可以把用户激活给关了,直接创建帐号就好了
在.env文件中
WIZARD_NEED_ACTIVATE=false
from wizard.
可以的,你可以把用户激活给关了,直接创建帐号就好了
在.env文件中
WIZARD_NEED_ACTIVATE=false
麻烦您提供下具体的创建命令,感谢!
from wizard.
这样吧,你在.env文件中,把这个配置项加上
WIZARD_NEED_ACTIVATE=false
数据库中把用户表数据清空一下,重新从页面上注册就可以了
from wizard.
这样吧,你在.env文件中,把这个配置项加上
WIZARD_NEED_ACTIVATE=false
数据库中把用户表数据清空一下,重新从页面上注册就可以了
邮件激活false后,成功注册,感觉是这边.env邮件没有配置的原因呢
from wizard.
php artisan migrate
-
Application In Production! *
Do you really wish to run this command? (yes/no) [no]:
yes
In Connection.php line 664:
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = wizard_2 and table_name = migrations and table_type = 'BASE TABLE')
In PDOConnection.php line 31:
SQLSTATE[HY000] [2002] Connection refused
In PDOConnection.php line 27:
SQLSTATE[HY000] [2002] Connection refused
from wizard.
php artisan migrate
Application In Production! *
Do you really wish to run this command? (yes/no) [no]:
yes
In Connection.php line 664:
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = wizard_2 and table_name = migrations and table_type = 'BASE TABLE')
In PDOConnection.php line 31:
SQLSTATE[HY000] [2002] Connection refused
In PDOConnection.php line 27:
SQLSTATE[HY000] [2002] Connection refused
你得改一下数据库的连接配置啊,改成你数据库的链接信息,还有需要提前创建好数据库。
from wizard.
数据库迁移问题
容器构建后
数据库配置有什么问题吗
本机可以远程访问到虚拟机的mysql 但是虚拟机本地反而被拒绝
from wizard.
Related Issues (20)
- 建议出个java版本的 HOT 1
- 有管理员账号和权限吗 HOT 3
- 一个用户加入多个用户组,只能看到一个用户组的项目
- 支持全文搜索引擎的url地址和鉴权信息在哪里修改?wizard页面创建的内容怎么同步到搜索引擎数据库? HOT 5
- 下载文档的文件名称是随机英文数字
- Table 'wizard_2.wz_project_catalogs' doesn't exist HOT 1
- Docker部署时遇到SQLSTATE[HY000] [2002] Connection refused HOT 4
- 请教两个功能 HOT 1
- 问下支持多语言吗? HOT 1
- 请问有没有文章仅同组用户的配置?
- LDAP接入配置后,登录提示”账号信息不合法“。 HOT 5
- 开发计划之文档分享,递归分享目录及子目录,文档,还是很有必要的
- 1.3.2版本上传附件报500错误,1.3.1是正常的 HOT 1
- 成功启动后,WEB访问页很多错误!
- php 7.4.33 下 composer 安装时就出错 HOT 2
- [LDAP接入问题] 账户信息不合法 HOT 2
- 可否在分享文档的页面加上密码或者文档保护性认证
- 表格最大行限制
- 同步swagger文档如果链接带有base auth 会同步失败
- 访问时https 会跳http的问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wizard.