当前位置:首页 > 计算机相关 > mysql > 正文内容

wordpress的数据库从myisam转innodb格式

piikee11个月前 (05-22)mysql1371

直接执行以下语句:

ALTER TABLE wp_commentmeta ENGINE=InnoDB;
ALTER TABLE wp_terms ENGINE=InnoDB;
ALTER TABLE wp_term_relationships ENGINE=InnoDB;
ALTER TABLE wp_term_taxonomy ENGINE=InnoDB;
ALTER TABLE wp_usermeta ENGINE=InnoDB;
ALTER TABLE wp_options ENGINE=InnoDB;
ALTER TABLE wp_postmeta ENGINE=InnoDB;
ALTER TABLE wp_termmeta ENGINE=InnoDB;
 
 
ALTER TABLE wp_comments 
    MODIFY COLUMN comment_date DATETIME DEFAULT CURRENT_TIMESTAMP,
    MODIFY COLUMN comment_date_gmt DATETIME DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE wp_comments ENGINE=InnoDB;


ALTER TABLE wp_links 
    MODIFY COLUMN link_updated DATETIME DEFAULT CURRENT_TIMESTAMP;

ALTER TABLE wp_links ENGINE=InnoDB;


ALTER TABLE wp_users 
    MODIFY COLUMN user_registered DATETIME DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE wp_users ENGINE=InnoDB;


update  `wp_posts`  set 	post_modified_gmt=	post_modified;
update  `wp_posts`  set 	 post_date_gmt=	post_date;
ALTER TABLE wp_posts 
    MODIFY COLUMN post_date DATETIME DEFAULT CURRENT_TIMESTAMP,
    MODIFY COLUMN post_modified DATETIME DEFAULT CURRENT_TIMESTAMP,
    MODIFY COLUMN post_modified_gmt DATETIME DEFAULT CURRENT_TIMESTAMP,
    MODIFY COLUMN post_date_gmt DATETIME DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE wp_posts ENGINE=InnoDB;


扫描二维码推送至手机访问。

版权声明:本文由萍客小居[www.piikee.net]发布,如需转载请注明出处。

本文链接:https://www.piikee.net/1524.html

分享给朋友:
返回列表

上一篇:mysql8.0安装后没有密码

没有最新的文章了...

评论列表

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。