sql 使用这些MySQL查询修复WordPress数据库编码问题...来源#1:http://tanyanam.com/technology/fixing-encoding-issues-on-wo
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 使用这些MySQL查询修复WordPress数据库编码问题...来源#1:http://tanyanam.com/technology/fixing-encoding-issues-on-wo相关的知识,希望对你有一定的参考价值。
ALTER DATABASE 'my_wp_database' CHARACTER SET utf8;
ALTER TABLE 'wp_comments' CHARACTER SET utf8;
alter table 'wp_comments' change comment_content comment_content LONGTEXT CHARACTER SET utf8;
alter table 'wp_comments' change comment_author comment_author LONGTEXT CHARACTER SET utf8;
update `wp_posts` set `post_content` = replace(`post_content` ,'á','á');
update `wp_posts` set `post_content` = replace(`post_content` ,'é','é');
update `wp_posts` set `post_content` = replace(`post_content` ,'í©','é');
update `wp_posts` set `post_content` = replace(`post_content` ,'ó','ó');
update `wp_posts` set `post_content` = replace(`post_content` ,'íº','ú');
update `wp_posts` set `post_content` = replace(`post_content` ,'ú','ú');
update `wp_posts` set `post_content` = replace(`post_content` ,'ñ','ñ');
update `wp_posts` set `post_content` = replace(`post_content` ,'í‘','Ñ');
update `wp_posts` set `post_content` = replace(`post_content` ,'Ã','í');
update `wp_posts` set `post_content` = replace(`post_content` ,'–','–');
update `wp_posts` set `post_content` = replace(`post_content` ,'—','–');
update `wp_posts` set `post_content` = replace(`post_content` ,'’','\'');
update `wp_posts` set `post_content` = replace(`post_content` ,'…','...');
update `wp_posts` set `post_content` = replace(`post_content` ,'–','-');
update `wp_posts` set `post_content` = replace(`post_content` ,'“','"');
update `wp_posts` set `post_content` = replace(`post_content` ,'â€','"');
update `wp_posts` set `post_content` = replace(`post_content` ,'‘','\'');
update `wp_posts` set `post_content` = replace(`post_content` ,'•','-');
update `wp_posts` set `post_content` = replace(`post_content` ,'‡','c');
update `wp_posts` set `post_content` = replace(`post_content` ,'Â','');
update `wp_posts` set `post_title` = replace(`post_title` ,'á','á');
update `wp_posts` set `post_title` = replace(`post_title` ,'é','é');
update `wp_posts` set `post_title` = replace(`post_title` ,'í©','é');
update `wp_posts` set `post_title` = replace(`post_title` ,'ó','ó');
update `wp_posts` set `post_title` = replace(`post_title` ,'íº','ú');
update `wp_posts` set `post_title` = replace(`post_title` ,'ú','ú');
update `wp_posts` set `post_title` = replace(`post_title` ,'ñ','ñ');
update `wp_posts` set `post_title` = replace(`post_title` ,'í‘','Ñ');
update `wp_posts` set `post_title` = replace(`post_title` ,'Ã','í');
update `wp_posts` set `post_title` = replace(`post_title` ,'–','–');
update `wp_posts` set `post_title` = replace(`post_title` ,'—','–');
update `wp_posts` set `post_title` = replace(`post_title` ,'’','\'');
update `wp_posts` set `post_title` = replace(`post_title` ,'…','...');
update `wp_posts` set `post_title` = replace(`post_title` ,'–','-');
update `wp_posts` set `post_title` = replace(`post_title` ,'“','"');
update `wp_posts` set `post_title` = replace(`post_title` ,'â€','"');
update `wp_posts` set `post_title` = replace(`post_title` ,'‘','\'');
update `wp_posts` set `post_title` = replace(`post_title` ,'•','-');
update `wp_posts` set `post_title` = replace(`post_title` ,'‡','c');
update `wp_posts` set `post_title` = replace(`post_title` ,'Â','');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'á','á');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'é','é');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'í©','é');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'ó','ó');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'íº','ú');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'ú','ú');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'ñ','ñ');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'í‘','Ñ');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'Ã','í');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'–','–');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'—','–');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'’','\'');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'…','...');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'–','-');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'“','"');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'â€','"');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'‘','\'');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'•','-');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'‡','c');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'Â','');
以上是关于sql 使用这些MySQL查询修复WordPress数据库编码问题...来源#1:http://tanyanam.com/technology/fixing-encoding-issues-on-wo的主要内容,如果未能解决你的问题,请参考以下文章