我正在尝试通过 drush 创建一个DKAN站点,但我目前在站点安装方面遇到了一些问题。我已经下载了 drush、dkan 和 mysql,并且 mysql 服务器当前运行版本为mysql Ver 14.14 Distrib 5.7.13, for osx10.11 (x86_64) using EditLine wrapper
.
说mysql密码root@localhost
是passw0rd
。然后我drush site-install dkan --db-url="mysql://root:passw0rd@localhost/dkandb"
从我的 dkan/webroot 目录中运行命令。
安装开始,“开始 Drupal 安装。这需要一段时间。” 但大约一分钟后,我得到以下异常:
exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1171 All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead' in /Users/Nicholas/dkan/webroot/includes/database/database.inc:2204
连同 25 项堆栈跟踪:
Stack trace:
#0 /Users/Nicholas/dkan/webroot/includes/database/database.inc(2204): PDOStatement->execute(Array)
#1 /Users/Nicholas/dkan/webroot/includes/database/database.inc(683): DatabaseStatementBase->execute(Array, Array)
#2 /Users/Nicholas/dkan/webroot/includes/database/schema.inc(664): DatabaseConnection->query('CREATE TABLE {p...')
#3 /Users/Nicholas/dkan/webroot/includes/database/database.inc(2753): DatabaseSchema->createTable('panelizer_entit...', Array)
#4 /Users/Nicholas/dkan/webroot/includes/common.inc(7092): db_create_table('panelizer_entit...', Array)
#5 /Users/Nicholas/dkan/webroot/includes/module.inc(479): drupal_install_schema('panelizer')
#6 /Users/Nicholas/dkan/webroot/includes/install.core.inc(1609): module_enable(Array, false)
#7 [internal function]: _install_module_batch('panelizer', 'Panelizer', Array)
#8 /Users/Nicholas/dkan/webroot/includes/batch.inc(284): call_user_func_array('_install_module...', Array)
#9 /Users/Nicholas/dkan/webroot/includes/form.inc(4714): _batch_process()
#10 /Users/Nicholas/dkan/webroot/includes/install.core.inc(444): batch_process('install.php?pro...', 'http://default/...')
#11 /Users/Nicholas/dkan/webroot/includes/install.core.inc(339): install_run_task(Array, Array)
#12 /Users/Nicholas/dkan/webroot/includes/install.core.inc(77): install_run_tasks(Array)
#13 /usr/local/Cellar/drush/HEAD-c967802/libexec/includes/drush.inc(725): install_drupal(Array)
#14 /usr/local/Cellar/drush/HEAD-c967802/libexec/includes/drush.inc(711): drush_call_user_func_array('install_drupal', Array)
#15 /usr/local/Cellar/drush/HEAD-c967802/libexec/commands/core/drupal/site_install_7.inc(82): drush_op('install_drupal', Array)
#16 /usr/local/Cellar/drush/HEAD-c967802/libexec/commands/core/site_install.drush.inc(245): drush_core_site_install_version('dkan', Array)
#17 [internal function]: drush_core_site_install('dkan')
#18 /usr/local/Cellar/drush/HEAD-c967802/libexec/includes/command.inc(366): call_user_func_array('drush_core_site...', Array)
#19 /usr/local/Cellar/drush/HEAD-c967802/libexec/includes/command.inc(217): _drush_invoke_hooks(Array, Array)
#20 [internal function]: drush_command('dkan')
#21 /usr/local/Cellar/drush/HEAD-c967802/libexec/includes/command.inc(185): call_user_func_array('drush_command', Array)
#22 /usr/local/Cellar/drush/HEAD-c967802/libexec/lib/Drush/Boot/BaseBoot.php(73): drush_dispatch(Array)
#23 /usr/local/Cellar/drush/HEAD-c967802/libexec/includes/preflight.inc(88): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#24 /usr/local/Cellar/drush/HEAD-c967802/libexec/drush.php(12): drush_main()
#25 {main}
关于我可以做些什么来消除SQLSTATE[42000]
错误的任何想法?