{"id":66,"date":"2005-02-24T16:35:12","date_gmt":"2005-02-25T00:35:12","guid":{"rendered":"http:\/\/www.laurenwood.org\/anyway\/archives\/2005\/02\/24\/debian-upgrading\/"},"modified":"2005-06-22T07:04:44","modified_gmt":"2005-06-22T14:04:44","slug":"upgrading-mysql-on-debian","status":"publish","type":"post","link":"https:\/\/www.laurenwood.org\/anyway\/2005\/02\/upgrading-mysql-on-debian\/","title":{"rendered":"Upgrading MySQL on Debian"},"content":{"rendered":"<p>I\u2019ve been wait\u00ading patiently for the updated <a href=\"http:\/\/wordpress.org\">Word\u00adPress<\/a> to come out. Once it did, I decided I should really update <a href=\"http:\/\/www.mysql.org\">MySQL<\/a> as well, so that I could finally serve pages prop\u00aderly as <span class=\"caps\">UTF<\/span>\u20118. I\u2019d been run\u00adning MySQL 3.23, and so I needed to upgrade to 4.0 to get real <span class=\"caps\">UTF<\/span>\u20118 sup\u00adport. I also con\u00adtem\u00adplated upgrad\u00ading to MySQL 4.1.<\/p>\n<p>The pro\u00adcess was just com\u00adplic\u00adated enough that I figured I should do the backup brain thing and dump the pro\u00adced\u00adure here; it might help someone else to have the gory details doc\u00adu\u00admented, and it will cer\u00adtainly help me when I come to upgrade!<\/p>\n<p>I haven\u2019t really used a Unix sys\u00adtem since I had to move to Win\u00addows in 1996; for\u00adtu\u00adnately Debi\u00adan makes upgrad\u00ading and installing really easy (who\u00adever came up with the <code>apt-get<\/code> sys\u00adtem deserves lots of praise). I run the <em>stable<\/em> ver\u00adsion of Debi\u00adan because it was set up on <em>stable<\/em> in the first place and I\u2019ve nev\u00ader really needed to change that and I\u2019d rather have the secur\u00adity patches be applied auto\u00admat\u00adic\u00adally. Except for, the Debi\u00adan <em>stable<\/em> ver\u00adsion of MySQL is, of course, 3.23 and not 4.0. The best solu\u00adtion to this seemed to be to install the back\u00adport of MySQL 4.0 from <a href=\"http:\/\/www.backports.org\">backports.org<\/a>.  In the\u00adory this is really easy, of course in prac\u00adtice it does take a cer\u00adtain know\u00adledge of how Debi\u00adan works. This is because Debi\u00adan Does Everything Dif\u00adfer\u00adently (<span class=\"caps\">DDED<\/span>). I\u2019m sure there is lots of logic in how Debi\u00adan does things, I just have nev\u00ader quite taken the time to fig\u00adure it out. And up till now, I did\u00adn\u2019t need to. I did have one big advant\u00adage though, <a href=\"http:\/\/usefulinc.com\/edd\/blog\/\">Edd Dum\u00adbill<\/a> was online and was able to help me fig\u00adure out those little details that make the dif\u00adfer\u00adence between frus\u00adtra\u00adtion and success.<\/p>\n<p>So here\u2019s the step-by-step upgrade details I needed. Debi\u00adan experts have no need to read any further\u2026<\/p>\n<ol>\n<li>Add the line <code>deb http:\/\/www.backports.org\/debian stable mysql-dfsg<\/code> into your <code>\/etc\/apt\/sources.list<\/code> file (I don\u2019t know why it\u2019s called <code>dfsg<\/code> and I\u2019m not sure I want to&nbsp;know).<\/li>\n<li>Run <code>apt-get update<\/code> and then <code>apt-get upgrade<\/code>, or <code>apt-get dist-upgrade<\/code>.<\/li>\n<li>Find that although the pack\u00adage list gets updated, noth\u00ading hap\u00adpens and the mes\u00adsage is \u201c0 to install\u201d<\/li>\n<li>Edd sug\u00adgests check\u00ading the policy with <code>apt-cache policy mysql-server<\/code>.<\/li>\n<li>This shows that Sur\u00adprise! the upgrade isn\u2019t being installed.<\/li>\n<li>To increase the pri\u00ador\u00adity, we need to pin the back\u00adport. Edd tells me the magic incant\u00ada\u00adtion, which is to cre\u00adate a <code>\/etc\/apt\/preferences<\/code> file with the contents<br>\n<code>Package: *<br>\nPin: release a=backports.org<br>\nPin-Priority: 995<\/code><\/li>\n<li>apt-get upgrade now works! Hurrah!<\/li>\n<li>Next to run <code>mysql_fix_privilege_tables<\/code> to fix the <span class=\"caps\">GRANT<\/span> tables etc. Except for, the MySQL data\u00adbase root account has spaces in the pass\u00adword and this script does\u00adn\u2019t like that. Even hard\u00adcod\u00ading the pass\u00adword in the script does\u00adn\u2019t&nbsp;work.<\/li>\n<li>Use <code>mysqladmin<\/code> to change the root pass\u00adword so it no longer has spaces in it (<span class=\"caps\">BTW<\/span>, does any\u00adone else find it annoy\u00ading that some MySQL things use <code>executable u=username<\/code> and oth\u00aders use <code>executable u username<\/code>? For\u00adtu\u00adnately PHPMy\u00adAd\u00admin makes most of my MySQL admin duties much easier).<\/li>\n<li>Suc\u00adcess! The blog still works, the tables appear to have been fixed, and life goes back to nor\u00admal. I decide to not upgrade to MySQL 4.1 just yet, since I don\u2019t really need to. This box in the base\u00adment acts as my fire\u00adwall, <span class=\"caps\">DSL<\/span> con\u00adnec\u00adtion, and web\u00adsite host; stick\u00ading with a stable con\u00adfig\u00adur\u00ada\u00adtion strikes me as being a good idea most of the&nbsp;time.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>I\u2019ve been wait\u00ading patiently for the updated Word\u00adPress to come out. Once it did, I decided I should really update MySQL as well, so that I could finally serve pages prop\u00aderly as <span class=\"caps\">UTF<\/span>\u20118. I\u2019d been run\u00adning MySQL 3.23, and so I needed to upgrade to 4.0 to get real <span class=\"caps\">UTF<\/span>\u20118 sup\u00adport. I also con\u00adtem\u00adplated upgrad\u00ading \u2026 <a href=\"https:\/\/www.laurenwood.org\/anyway\/2005\/02\/upgrading-mysql-on-debian\/\" class=\"more-link\">Con\u00adtin\u00adue read\u00ading<span class=\"screen-reader-text\"> \u201cUpgrad\u00ading MySQL on Debian\u201d<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wp_typography_post_enhancements_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"","activitypub_status":"","footnotes":""},"categories":[6],"tags":[],"class_list":["post-66","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/posts\/66","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/comments?post=66"}],"version-history":[{"count":0,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/posts\/66\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/media?parent=66"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/categories?post=66"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laurenwood.org\/anyway\/wp-json\/wp\/v2\/tags?post=66"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}