mysql数据库迁移备忘(4.0.22 -> 5.0.37)

  • user warning: Table './zgq_smzz/blog_comments' is marked as crashed and should be repaired query: SELECT COUNT(*) FROM blog_comments c WHERE c.nid = 20 AND c.status = 0 in /home/www/zhouguoqiang/zhoume.org/modules/comment/comment.module on line 992.
  • user warning: Table './zgq_smzz/blog_comments' is marked as crashed and should be repaired query: SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.signature_format, u.picture, u.data, c.thread, c.status FROM blog_comments c INNER JOIN blog_users u ON c.uid = u.uid WHERE c.nid = 20 AND c.status = 0 ORDER BY c.thread DESC LIMIT 0, 50 in /home/www/zhouguoqiang/zhoume.org/modules/comment/comment.module on line 992.

旧mysql版本为4.0.22,新数据库版本为5.0.37,旧库中使用的字符集为utf8,phpmyadmin版本均为2.9.11,具体过程如下:
先在使用phpmyadmin从虚拟主机mysql4.0.22的数据以sql语句方式导出,然后在本地mysql5.0.37上同样使用phpmyadmin导入,发现有如下地方需要修改

old
new
备注

`type` enum('原创','转载') NOT NULL default '转载',
`type` enum('原创','转载') NOT NULL,
如果enum的值为英文,则无需修改

) TYPE=MyISAM AUTO_INCREMENT=185 ;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=185 ;

) TYPE=HEAP MAX_ROWS=500;
) TYPE=HEAP MAX_ROWS=500;

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options