Home >Database >Mysql Tutorial >(原创)MySQL 5.6导入SQL报错解决方法:ERROR 1064 (42000): ~~

(原创)MySQL 5.6导入SQL报错解决方法:ERROR 1064 (42000): ~~

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 16:40:112834browse

PS:今天在部署一个cacti网络监控系统时遇到一个MySQL导入SQL报错,这个cacti部署文档之前也部署过多次了,没这个问题。想了一下,应该是数据库版本兼容性问题,因为我用了最新的MySQL5.6。之前部署cacti都是用MySQL5.1。总结一下: 导入cacti.sql文件时报错

PS:今天在部署一个cacti网络监控系统时遇到一个MySQL导入SQL报错,这个cacti部署文档之前也部署过多次了,没这个问题。想了一下,应该是数据库版本兼容性问题,因为我用了最新的MySQL5.6。之前部署cacti都是用MySQL5.1。总结一下: 导入cacti.sql文件时报错信息如下: ERROR 1064 (42000): 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 'TYPE=MyISAM' at line 9 原因:cacti.sql文件是在MySQL5.0或5.1编写的。如果在5.5和5.6上面导入会报错。 解决方法: 1、用vim打开cacti.sql; 2、用命令:%s/TYPE=MyISAM/ENGINE=MyISAM/g批量查找替换,将数据库文件内的所有TYPE=MyISAM修改为ENGINE=MyISAM,保存退出; 3、重新导入cacti.sql即可。 如图所示:
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn