因工作需求,需要把mysql4.0.17中的数据库导入到mysql-5.5.21中,但是在导入的错误中遇到了大量错误,现将错误贴出供自己以后方便!!!
1.第一次导入
[root@CentOS62 ~]# mysql -uroot -p ceshi < /root/download/9999.sql
ERROR 1064 (42000) at line 11: 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 10
解决办法:
原因:编写数据库的版本比当前安装的版本不相同。
解决:
1、用文本编辑器打开9999.sql;
2、查找/替换,将数据库文件内的所有TYPE=MyISAM修改为ENGINE=MyISAM,保存退出;
3、重新导入9999.sql即可。
2.第二次导入
[root@CentOS62 ~]# mysql -uroot -p ceshi < /root/download/8888.sql
ERROR 1064 (42000) at line 89: 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=InnoDB' at line 10
解决办法:
TYPE=InnoDB修改成ENGINE=InnoDB;
3.第三次导入
[root@CentOS62 ~]# mysql -uroot -p ceshi < /root/download/7777.sql
ERROR 1064 (42000) at line 368: 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 'read
int(11) default '0',
content text,
PRIMARY KEY (id)
) ENGINE = MYISAM' at line 8
解决办法:
CREATE TABLE news (
`id` int(11) NOT NULL auto_increment,
`type` int(11) default NULL,
`title` varchar(200) default NULL,
`source` varchar(50) default NULL,
`author` varchar(50) default NULL,
`addtime` int(11) default '0',
`read` int(11) default '0',
`content` text,
PRIMARY KEY (`id`)
)ENGINE=MyISAM;