{"id":7731,"date":"2019-07-17T12:03:36","date_gmt":"2019-07-17T12:03:36","guid":{"rendered":"https:\/\/www.milesweb.in\/hosting-faqs\/?p=7731"},"modified":"2019-07-17T12:03:36","modified_gmt":"2019-07-17T12:03:36","slug":"upgrade-mysql-on-centos","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/","title":{"rendered":"Learn to Upgrade MySQL on CentOS"},"content":{"rendered":"<p>In this guide you will learn to upgrade the MySQL version on your dedicated server. For this you will need to be logged into the server command line as the root user. Make sure you follow all of the steps very carefully as your databases can easily get corrupted, if this upgrade is not done properly. Also, please do keep updated backups of your databases before upgrading.<\/p>\n<p><strong>NOTE:<\/strong> You will require root access to upgrade MySQL.<\/p>\n<p>With the root user, log into your server via SSH.<\/p>\n<p>Then, create a directory for storing the backups and list the databases are already backed up.<\/p>\n<pre class=\"lang:default decode:true \">mkdir \/root\/dbbackups; touch \/root\/dbbackups\/list<\/pre>\n<p>Next, take the backup of the databases. Don\u2019t panic if you get a SELECT and LOCK error on certain tables related to the schema databases.<\/p>\n<pre class=\"lang:default decode:true\">for db in $( mysql -e \u2018show databases\u2019 | grep -v \u201cDatabase\\|information_schema\u201d | awk \u2018{print $1}\u2019 ) ; \r\ndo mysqldump \u2013add-drop-table $db &gt; \/root\/dbbackups\/$db.sql &amp;&amp; echo $db &gt;&gt; \/root\/dbbackups\/list; done<\/pre>\n<p>Edit the \/var\/cpanel\/cpanel.config file with your preferred editor (nano, vim, vi, etc). In this example, we are using vim as below:<\/p>\n<pre class=\"lang:default decode:true \">vim \/var\/cpanel\/cpanel.config<\/pre>\n<p>Search for mysql-version (default is around line 180) and change it to the desired version.<\/p>\n<p>Save the file and execute the below command for cPanel to upgrade or downgrade your MySQL version.<\/p>\n<pre class=\"lang:default decode:true \">\/usr\/local\/cpanel\/scripts\/check_cpanel_rpms \u2013fix<\/pre>\n<p>Once the script is complete and there are no errors indicating it failed. Then log into the MySQL command interface and you will see the following. In this tutorial, we have downgraded from 5.6 to 5.5:<\/p>\n<pre class=\"lang:default decode:true \">mysql -u root<\/pre>\n<p>Welcome to the MySQL monitor. Commands end with ; or \\g.<br \/>\nYour MySQL connection id is 11<br \/>\nServer version: 5.5.49-cll MySQL Community Server (GPL)<\/p>\n<p>Copyright (c) 2000, 2016, Oracle and\/or its affiliates. All rights reserved.<\/p>\n<p>Oracle Corporation and\/or its affiliates have trademarked Oracle. Respective owners might have trademarked other names.<\/p>\n<p>Type \u2018help;\u2019 or \u2018\\h\u2019 for help. Type \u2018\\c\u2019 to clear the current input statement.<\/p>\n<pre class=\"lang:default decode:true \">mysql&gt;<\/pre>\n<p>For bring on the safe side, you might need to repair the databases as a preventative measure.<\/p>\n<pre class=\"lang:default decode:true \">mysqlcheck -aR<\/pre>\n<p>Also, ensure that you run the following command to upgrade the system tables so there are no issues.<\/p>\n<pre class=\"lang:default decode:true \">mysql_upgrade<\/pre>\n<p>For restoring the databases that you have previously taken the backup of, you can use the following command.<\/p>\n<pre class=\"lang:default decode:true \">for db in `cat \/root\/dbbackups\/list` ; do mysql $db &lt; \/root\/dbbackups\/$db.sql ; done<\/pre>\n<p>You can use EasyApache within WHM to recompile PHP, since it is usually important due to the MySQL changes 90% of the time.<\/p>\n<p>In this way, you can upgrade MySQL on CentOS.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide you will learn to upgrade the MySQL version on your dedicated server. For this you will need to be logged into the server command line as the root user. Make sure you follow all of the steps very carefully as your databases can easily get corrupted, if this upgrade is not done [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[230],"tags":[205,889,890],"class_list":["post-7731","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-database","tag-mysql","tag-mysql-on-centos","tag-upgrade-mysql-on-centos"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Learn to Upgrade MySQL on CentOS<\/title>\n<meta name=\"description\" content=\"The article describes steps to upgrade MySQL on CentOS.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Learn to Upgrade MySQL on CentOS\" \/>\n<meta property=\"og:description\" content=\"The article describes steps to upgrade MySQL on CentOS.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-17T12:03:36+00:00\" \/>\n<meta name=\"author\" content=\"Pallavi Godse\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pallavi Godse\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/\"},\"author\":{\"name\":\"Pallavi Godse\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\"},\"headline\":\"Learn to Upgrade MySQL on CentOS\",\"datePublished\":\"2019-07-17T12:03:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/\"},\"wordCount\":369,\"commentCount\":0,\"keywords\":[\"MySQL\",\"MySQL on CentOS\",\"Upgrade MySQL on CentOS\"],\"articleSection\":[\"Database\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/\",\"name\":\"Learn to Upgrade MySQL on CentOS\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\"},\"datePublished\":\"2019-07-17T12:03:36+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\"},\"description\":\"The article describes steps to upgrade MySQL on CentOS.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Learn to Upgrade MySQL on CentOS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\",\"name\":\"Pallavi Godse\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g\",\"caption\":\"Pallavi Godse\"},\"description\":\"Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.\",\"sameAs\":[\"https:\/\/www.milesweb.in\"],\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/author\/pallavi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Learn to Upgrade MySQL on CentOS","description":"The article describes steps to upgrade MySQL on CentOS.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/","og_locale":"en_US","og_type":"article","og_title":"Learn to Upgrade MySQL on CentOS","og_description":"The article describes steps to upgrade MySQL on CentOS.","og_url":"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2019-07-17T12:03:36+00:00","author":"Pallavi Godse","twitter_misc":{"Written by":"Pallavi Godse","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/#article","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/"},"author":{"name":"Pallavi Godse","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945"},"headline":"Learn to Upgrade MySQL on CentOS","datePublished":"2019-07-17T12:03:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/"},"wordCount":369,"commentCount":0,"keywords":["MySQL","MySQL on CentOS","Upgrade MySQL on CentOS"],"articleSection":["Database"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/","name":"Learn to Upgrade MySQL on CentOS","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website"},"datePublished":"2019-07-17T12:03:36+00:00","author":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945"},"description":"The article describes steps to upgrade MySQL on CentOS.","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/upgrade-mysql-on-centos\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"Learn to Upgrade MySQL on CentOS"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.in\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945","name":"Pallavi Godse","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g","caption":"Pallavi Godse"},"description":"Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.","sameAs":["https:\/\/www.milesweb.in"],"url":"https:\/\/www.milesweb.in\/hosting-faqs\/author\/pallavi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/7731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=7731"}],"version-history":[{"count":1,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/7731\/revisions"}],"predecessor-version":[{"id":7732,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/7731\/revisions\/7732"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=7731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=7731"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=7731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}