我使用duplicator插件导出了我的wordpress网站之一.现在,当我尝试在我的localhost上设置它时,它无法在数据库中导入几个表.这导致网站无法在localhost上运行.
检查doplicator插件日志时我遇到了很多错误,很少有:
**********************************************************************
Run Code Online (Sandbox Code Playgroud)
版本:1.1.0 PHP:7.0.2 | SAPI:apache2handler SERVER:Apache/2.4.17(Win64)PHP/7.0.2
数据库例程
------------- SERVER ENVIROMENT ------------- MYSQL版本:5.7.9超时:5000 MAXPACK:1048576 ---------- ---数据库结果-------------
**ERROR** database error write ‘Invalid default value for ‘comment_date” – [sql=
CREATE TABLE wp_comments (
comment_ID bigint(20) unsigned NOT NULL A…]
**ERROR** database error write ‘Invalid default value for ‘created” – [sql=
CREATE TABLE wp_duplicator_packages (
id bigint(20) unsigned NOT NUL…]
**ERROR** database error write ‘Invalid default value for ‘link_updated” – [sql=
CREATE TABLE wp_links (
link_id bigint(20) unsigned NOT NULL AUTO_IN…]
**ERROR** database error write ‘Invalid default value for ‘post_date” – [sql=
CREATE TABLE wp_posts (
ID bigint(20) unsigned NOT NULL AUTO_INCREME…]
**ERROR** database error write ‘Invalid default value for ‘user_registered” – [sql=
CREATE TABLE wp_users (
ID bigint(20) unsigned NOT NULL AUTO_INCREME…]
**ERROR** database error write ‘Table ‘ne.wp_duplicator_packages’ doesn’t exist’ – [sql=
/* INSERT TABLE DATA: wp_duplicator_packages */
INSERT INTO `wp_duplicato…]
**ERROR** database error write ‘Table ‘ne.wp_duplicator_packages’ doesn’t exist’ – [sql=INSERT INTO wp_duplicator_packages VALUES(“2”, “20151126_naturalexpressio…]
**ERROR** database error write ‘Table ‘ne.wp_duplicator_packages’ doesn’t exist’ – [sql=INSERT INTO wp_duplicator_packages VALUES(“3”, “20151126_naturalexpressio…]
**ERROR** database error write ‘Table ‘ne.wp_posts’ doesn’t exist’ – [sql=
/* INSERT TABLE DATA: wp_posts */
INSERT INTO wp_posts VALUES(“4”, “1”, …]
**ERROR** database error write ‘Table ‘ne.wp_posts’ doesn’t exist’ – [sql=INSERT INTO wp_posts VALUES(“5”, “1”, “2015-09-07 14:22:39”, “2015-09-07 …]
**ERROR** database error write ‘Table ‘ne.wp_posts’ doesn’t exist’ – [sql=INSERT INTO wp_posts VALUES(“7”, “1”, “2015-09-07 14:30:51”, “2015-09-07 …]
**ERROR** database error write ‘Table ‘ne.wp_posts’ doesn’t exist’ – [sql=INSERT INTO wp_posts VALUES(“8”, “1”, “2015-09-07 14:32:08”, “2015-09-07 …]
**ERROR** database error write ‘Table ‘ne.wp_posts’ doesn’t exist’ – [sql=INSERT INTO wp_posts VALUES(“9”, “1”, “2015-09-07 14:32:36”, “2015-09-07 …]
**ERROR** database error write ‘Table ‘ne.wp_posts’ doesn’t exist’ – [sql=INSERT INTO wp_posts VALUES(“10”, “1”, “2015-09-07 14:33:05”, “2015-09-07…]
**ERROR** database error write ‘Table ‘ne.wp_posts’ doesn’t exist’ – [sql=INSERT INTO wp_posts VALUES(“11”, “1”, “2015-09-07 14:34:39”, “2015-09-07…]
**ERROR** database error write ‘Table ‘ne.wp_posts’ doesn’t exist’ – [sql=INSERT INTO wp_posts VALUES(“19”, “1”, “2015-09-09 08:33:24”, “2015-09-09…]
Run Code Online (Sandbox Code Playgroud)
我用google搜索,发现用NO_ENGINE_SUBSTITUTION更新sql_mode将解决问题.
由于我使用LAMP,我打开/etc/mysql/my.cnf并添加以下行:
sql_mode=NO_ENGINE_SUBSTITUTION
Run Code Online (Sandbox Code Playgroud)
并使用以下命令重新启动apache服务器:
sudo service apache2 restart
Run Code Online (Sandbox Code Playgroud)
但它并没有解决问题.让我知道你的解决方案....谢谢.
Sha*_*lom 22
刚刚找到了解决我的问题的wordpress支持主题的解决方案.解决方案是更新duplocator包中的database.sql文件.以下是步骤:
在文件顶部添加以下行.
SET SESSION sql_mode ='NO_ENGINE_SUBSTITUTION';
| 归档时间: |
|
| 查看次数: |
6749 次 |
| 最近记录: |