{"id":1655,"date":"2009-12-21T22:15:20","date_gmt":"2009-12-21T22:15:20","guid":{"rendered":"https:\/\/www.diaryofanadi.co.uk\/?p=1655"},"modified":"2009-12-21T22:15:20","modified_gmt":"2009-12-21T22:15:20","slug":"mysql-find-replace","status":"publish","type":"post","link":"https:\/\/diaryofanadi.co.uk\/?p=1655","title":{"rendered":"MySQL Find &#038; Replace"},"content":{"rendered":"<p>As an artefact to upgrading my database from mySQL 4.0 to mySQL 5.0 (so I could apply the latest WordPress update), I noticed a whole heap of\u00a0 &#8216;\u00c2&#8217; symbols had appeared in my previous posts.<\/p>\n<p>I started to edit them out, then realised there must be a better way. Thanks to <a title=\"Brad J Frey Blog\" href=\"http:\/\/bradyjfrey.com\/blog\/mysql\/how-to-find-and-replace-in-mysql-phpmyadmin\/\" target=\"_blank\" rel=\"noopener noreferrer\"> Brad J Frey&#8217;s blog<\/a>, I fixed it in about 15 seconds.<\/p>\n<p>All you have to do is log into your PHPMyAdmin control panel for the database you want to change, then choose the SQL button, as shown here:<\/p>\n<div id=\"attachment_1656\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" aria-describedby=\"caption-attachment-1656\" class=\"size-full wp-image-1656 lazyload\" title=\"PHPMyAdmin For Database\" data-src=\"https:\/\/www.diaryofanadi.co.uk\/wp-content\/uploads\/2009\/12\/sql_1.gif\" alt=\"PHPMyAdmin For Database\" width=\"580\" height=\"438\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 580px; --smush-placeholder-aspect-ratio: 580\/438;\" \/><p id=\"caption-attachment-1656\" class=\"wp-caption-text\">PHPMyAdmin For Database<\/p><\/div>\n<p>This opens up a window &#8211; make sure you select the SQL tab:<\/p>\n<div id=\"attachment_1657\" style=\"width: 589px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" aria-describedby=\"caption-attachment-1657\" class=\"size-full wp-image-1657 lazyload\" title=\"MySQL Query Window\" data-src=\"https:\/\/www.diaryofanadi.co.uk\/wp-content\/uploads\/2009\/12\/sql_2.gif\" alt=\"MySQL Query Window\" width=\"579\" height=\"301\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 579px; --smush-placeholder-aspect-ratio: 579\/301;\" \/><p id=\"caption-attachment-1657\" class=\"wp-caption-text\">MySQL Query Window<\/p><\/div>\n<p>This is the query I used to get rid of the \u00c2 symbols:<\/p>\n<p><span style=\"color: #008000;\">UPDATE `wp_posts` SET post_content = replace(post_content,&#8221;\u00c2&#8221;,&#8221;&#8221;); <\/p>\n<p>The general format is:<\/p>\n<p><span style=\"color: #008000;\">UPDATE `tablename` SET fieldname = replace(fieldname,&#8221;what-to-replace&#8221;,&#8221;what-to-replace-with&#8221;); <\/p>\n<p>Just hit GO and the replace operation\u00a0is done very quickly.<\/p>\n<p> <strong>EDIT 22\/12\/2009: But even better than this, I found a plugin for WordPress which does the search and replace for you. Thanks to <\/strong>  <strong>thedeadone.net<\/strong> <strong> for that. It&#8217;s much better.<\/strong> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>As an artefact to upgrading my database from mySQL 4.0 to mySQL 5.0 (so I could apply the latest WordPress update), I noticed a whole heap of\u00a0 &#8216;\u00c2&#8217; symbols had appeared in my previous posts. I started to edit them out, then realised there must be a better way. Thanks to Brad J Frey&#8217;s blog, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[121],"tags":[],"class_list":["post-1655","post","type-post","status-publish","format-standard","hentry","category-latestposts"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1655"}],"version-history":[{"count":0,"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1655\/revisions"}],"wp:attachment":[{"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/diaryofanadi.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}