【发布时间】:2017-01-05 00:09:28
【问题描述】:
我正在尝试将我的 Drupal 7 站点从本地开发服务器部署到在线主机。
我使用 phpMyAdmin 中的导出功能导出我的数据库,然后也使用 phpMyAdmin 在主机端导入文件。两端的 PhpMyAdmin 版本相同,我尝试了快速导出和许多设置,在导入时匹配设置,每次都得到相同的 #1064 语法错误。但是我没有看到 SQL 有任何问题,对我来说它看起来不错。我还获取了导出的 SQL 并将其作为 SQL 语句粘贴到 phpMyAdmin 中,并在运行时得到完全相同的错误。
这是错误:
Error
Static analysis:
1 errors were found during analysis.
A closing bracket was expected. (near ")" at position 88)
SQL query:
CREATE TABLE IF NOT EXISTS `actions` ( `aid` varchar(255) NOT NULL DEFAULT '0'COMMENT )
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3
这是触发错误的 SQL 文件的顶部:
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
CREATE TABLE IF NOT EXISTS `actions` (
`aid` varchar(255) NOT NULL DEFAULT '0'COMMENT
);
INSERT INTO `actions` (`aid`, `type`, `callback`, `parameters`, `label`) VALUES
('comment_publish_action', 'comment', 'comment_publish_action', '', 'Publish comment'),
('comment_save_action', 'comment', 'comment_save_action', '', 'Save comment'),
('comment_unpublish_action', 'comment', 'comment_unpublish_action', '', 'Unpublish comment'),
('node_make_sticky_action', 'node', 'node_make_sticky_action', '', 'Make content sticky'),
('node_make_unsticky_action', 'node', 'node_make_unsticky_action', '', 'Make content unsticky'),
('node_promote_action', 'node', 'node_promote_action', '', 'Promote content to front page'),
('node_publish_action', 'node', 'node_publish_action', '', 'Publish content'),
('node_save_action', 'node', 'node_save_action', '', 'Save content'),
('node_unpromote_action', 'node', 'node_unpromote_action', '', 'Remove content from front page'),
('node_unpublish_action', 'node', 'node_unpublish_action', '', 'Unpublish content'),
('pathauto_node_update_action', 'node', 'pathauto_node_update_action', '', 'Update node alias'),
('pathauto_taxonomy_term_update_action', 'taxonomy_term', 'pathauto_taxonomy_term_update_action', '', 'Update taxonomy term alias'),
('pathauto_user_update_action', 'user', 'pathauto_user_update_action', '', 'Update user alias'),
('system_block_ip_action', 'user', 'system_block_ip_action', '', 'Ban IP address of current user'),
('user_block_user_action', 'user', 'user_block_user_action', '', 'Block current user');
其他人以前遇到过这种情况吗?有什么补救的建议吗?这应该可以工作(我之前已经这样做过),我不想为了安装备份和迁移模块来进行通用的新 Drupal 安装而备份该站点以执行此数据传输。
提前感谢您的帮助。
【问题讨论】:
标签: mysql drupal import phpmyadmin export