从Mysql工作台到phpmyadmin的Mysql表创建

从Mysql工作台到phpmyadmin的Mysql表创建,mysql,phpmyadmin,Mysql,Phpmyadmin,嗨,我在mysql工作台上为一个表示例_1 但是由于某些原因,我想用createtablesysntax重新创建phpmyadmin中的所有表,如下所示 在MYSQL工作台中创建表代码: CREATE TABLE `example_1` ( `job_id` int(11) NOT NULL AUTO_INCREMENT, `source_id` int(11) DEFAULT NULL, `publication_id` int(11) DEFAULT NULL, `facil

嗨,我在mysql工作台上为一个表
示例_1

但是由于某些原因,我想用
createtablesysntax
重新创建
phpmyadmin
中的所有表,如下所示

在MYSQL工作台中创建表代码

CREATE TABLE `example_1` (
  `job_id` int(11) NOT NULL AUTO_INCREMENT,
  `source_id` int(11) DEFAULT NULL,
  `publication_id` int(11) DEFAULT NULL,
  `facility_id` int(11) DEFAULT NULL,
  `job_type_id` int(11) NOT NULL,
  `template_id` int(11) DEFAULT NULL,
  `account_num` varchar(9) DEFAULT NULL,
  `start_dt` datetime DEFAULT NULL,
  `end_dt` datetime DEFAULT NULL,
  `pdf_path` varchar(20) DEFAULT NULL,
  `admin_user_id` int(11) NOT NULL,
  `skills` varchar(255) DEFAULT NULL,
  `tracking_pixel` varchar(255) DEFAULT NULL,
  `auto_renew` smallint(6) DEFAULT NULL,
  PRIMARY KEY (`job_id`),
  KEY `source_id_idxfk` (`source_id`),
  KEY `facility_id_idxfk` (`facility_id`),
  KEY `job_type_id_idxfk` (`job_type_id`),
  KEY `template_id_idxfk` (`template_id`),
  CONSTRAINT `jp_job_ibfk_1` FOREIGN KEY (`source_id`) REFERENCES `jp_source` (`source_id`),
  CONSTRAINT `jp_job_ibfk_2` FOREIGN KEY (`facility_id`) REFERENCES `adm_facility` (`facility_id`),
  CONSTRAINT `jp_job_ibfk_3` FOREIGN KEY (`job_type_id`) REFERENCES `jp_job_type` (`job_type_id`),
  CONSTRAINT `jp_job_ibfk_4` FOREIGN KEY (`template_id`) REFERENCES `jp_template` (`template_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
InnoDB  

Supports transactions, row-level locking, and foreign keys

[ Variables | Buffer Pool | InnoDB Status ]
我在
phpmyadmin
中复制并粘贴了相同的表,以创建相同的表,然后出现以下错误

错误

CREATE TABLE `example_1` (
  `job_id` int(11) NOT NULL AUTO_INCREMENT,
  `source_id` int(11) DEFAULT NULL,
  `publication_id` int(11) DEFAULT NULL,
  `facility_id` int(11) DEFAULT NULL,
  `job_type_id` int(11) NOT NULL,
  `template_id` int(11) DEFAULT NULL,
  `account_num` varchar(9) DEFAULT NULL,
  `start_dt` datetime DEFAULT NULL,
  `end_dt` datetime DEFAULT NULL,
  `pdf_path` varchar(20) DEFAULT NULL,
  `admin_user_id` int(11) NOT NULL,
  `skills` varchar(255) DEFAULT NULL,
  `tracking_pixel` varchar(255) DEFAULT NULL,
  `auto_renew` smallint(6) DEFAULT NULL,
  PRIMARY KEY (`job_id`),
  KEY `source_id_idxfk` (`source_id`),
  KEY `facility_id_idxfk` (`facility_id`),
  KEY `job_type_id_idxfk` (`job_type_id`),
  KEY `template_id_idxfk` (`template_id`),
  CONSTRAINT `jp_job_ibfk_1` FOREIGN KEY (`source_id`) REFERENCES `jp_source` (`source_id`),
  CONSTRAINT `jp_job_ibfk_2` FOREIGN KEY (`facility_id`) REFERENCES `adm_facility` (`facility_id`),
  CONSTRAINT `jp_job_ibfk_3` FOREIGN KEY (`job_type_id`) REFERENCES `jp_job_type` (`job_type_id`),
  CONSTRAINT `jp_job_ibfk_4` FOREIGN KEY (`template_id`) REFERENCES `jp_template` (`template_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
InnoDB  

Supports transactions, row-level locking, and foreign keys

[ Variables | Buffer Pool | InnoDB Status ]

请告诉我如何编辑代码以避免错误,并在phpmyadmin sql编辑器中创建一个表。您的服务器上似乎禁用了
INNODB
引擎。只需在
/etc/my.cnf
中删除innodb的所有禁用选项,然后重新启动
mysql

,感谢您的回复,我认为innodb没有被禁用,因为当我删除上面的约束行并创建了一个表时,相同的代码起作用,问题似乎出在constraint语句上,不知道如何解决。引用的表存在吗?@Lex:非常感谢,实际上没有引用表,所以我创建了这些表并再次运行查询,结果非常成功!对我来说太糟糕了,我没有把它作为asnswer发布。。。很高兴能帮上忙。嗯,别担心,如果你不介意的话,我还有一个问题,你可以看看