{"id":13898,"date":"2023-01-23T06:51:59","date_gmt":"2023-01-23T06:51:59","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=13898"},"modified":"2023-01-23T06:52:01","modified_gmt":"2023-01-23T06:52:01","slug":"how-to-install-latest-mysql-8-0-on-rhel-centos-and-fedora","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2023\/01\/23\/how-to-install-latest-mysql-8-0-on-rhel-centos-and-fedora\/","title":{"rendered":"How to Install Latest MySQL 8.0 on RHEL\/CentOS and Fedora"},"content":{"rendered":"<p><strong>MySQL<\/strong>&nbsp;is an open source free relational database management system (RDBMS) released under GNU (General Public License). It is used to run multiple databases on any single server by providing multi-user access to each created database.<\/p>\n<p>This article will walk through you the process of installing and updating latest&nbsp;<strong>MySQL 8.0<\/strong>&nbsp;version on&nbsp;<strong>RHEL\/CentOS 7\/6\/<\/strong>&nbsp;and&nbsp;<strong>Fedora 28-26<\/strong>&nbsp;using&nbsp;<strong>MySQL Yum<\/strong>&nbsp;repository via&nbsp;<strong>YUM<\/strong>&nbsp;utility.<\/p>\n<h3>Step 1: Adding the MySQL Yum Repository<\/h3>\n<p><strong>1.<\/strong>&nbsp;We will use official&nbsp;<strong>MySQL Yum<\/strong>&nbsp;software repository, which will provides RPM packages for installing the latest version of MySQL server, client, MySQL Utilities, MySQL Workbench, Connector\/ODBC, and Connector\/Python for the&nbsp;<strong>RHEL\/CentOS 7\/6\/<\/strong>&nbsp;and&nbsp;<strong>Fedora 28-26<\/strong>.<\/p>\n<p><strong>Important<\/strong>: These instructions only works on fresh installation of MySQL on the server, if there is already a MySQL installed using a third-party-distributed RPM package, then I recommend you to upgrade or replace the installed MySQL package using the&nbsp;<strong>MySQL Yum Repository<\/strong>\u201d.<\/p>\n<p>Before Upgrading or Replacing old MySQL package, don\u2019t forget to take all important databases backup and configuration files.<\/p>\n<p><strong>2.<\/strong>&nbsp;Now download and add the following&nbsp;<strong>MySQL Yum repository<\/strong>&nbsp;to your respective Linux distribution system\u2019s repository list to install the latest version of MySQL (i.e.&nbsp;<strong>8.0<\/strong>&nbsp;released on&nbsp;<strong>27 July 2018<\/strong>).<\/p>\n<pre>--------------- <strong>On RHEL\/CentOS 7<\/strong> ---------------\n# wget https:\/\/repo.mysql.com\/mysql80-community-release-el7-1.noarch.rpm\n<\/pre>\n<pre>--------------- <strong>On RHEL\/CentOS 6<\/strong> ---------------\n# wget https:\/\/dev.mysql.com\/get\/mysql80-community-release-el6-1.noarch.rpm\n<\/pre>\n<pre>--------------- <strong>On Fedora 28<\/strong> ---------------\n# wget https:\/\/dev.mysql.com\/get\/mysql80-community-release-fc28-1.noarch.rpm\n<\/pre>\n<pre>--------------- <strong>On Fedora 27<\/strong> ---------------\n# wget https:\/\/dev.mysql.com\/get\/mysql80-community-release-fc27-1.noarch.rpm\n<\/pre>\n<pre>--------------- <strong>On Fedora 26<\/strong> ---------------\n# wget https:\/\/dev.mysql.com\/get\/mysql80-community-release-fc26-1.noarch.rpm\n<\/pre>\n<p><strong>3.<\/strong>&nbsp;After downloading the package for your Linux platform, now install the downloaded package with the following command.<\/p>\n<pre>--------------- <strong>On RHEL\/CentOS 7<\/strong> ---------------\n# yum localinstall mysql80-community-release-el7-1.noarch.rpm\n<\/pre>\n<pre>--------------- <strong>On RHEL\/CentOS 6<\/strong> ---------------\n# yum localinstall mysql80-community-release-el6-1.noarch.rpm\n<\/pre>\n<pre>--------------- <strong>On Fedora 28<\/strong> ---------------\n# dnf localinstall mysql80-community-release-fc28-1.noarch.rpm\n<\/pre>\n<pre>--------------- <strong>On Fedora 27<\/strong> ---------------\n# dnf localinstall mysql80-community-release-fc27-1.noarch.rpm\n<\/pre>\n<pre>--------------- <strong>On Fedora 26<\/strong> ---------------\n# yum localinstall mysql80-community-release-fc26-1.noarch.rpm\n<\/pre>\n<p>The above installation command adds the&nbsp;<strong>MySQL Yum<\/strong>&nbsp;repository to system\u2019s repository list and downloads the GnuPG key to verify the integrity of the packages.<\/p>\n<p><strong>4.<\/strong>&nbsp;You can verify that the MySQL Yum repository has been added successfully by using following command.<\/p>\n<pre># yum repolist enabled | grep \"mysql.*-community.*\"\n# dnf repolist enabled | grep \"mysql.*-community.*\"      [On <strong>Fedora<\/strong> versions]\n<\/pre>\n<div id=\"attachment_16709\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/02\/Verify-MySQL-Yum-Repository.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-16709\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/02\/Verify-MySQL-Yum-Repository.png\" alt=\"Verify MySQL Yum Repository\" width=\"720\" height=\"400\" aria-describedby=\"caption-attachment-16709\" data-lazy-loaded=\"true\"><\/a><\/p>\n<p id=\"caption-attachment-16709\" class=\"wp-caption-text\">Verify MySQL Yum Repository<\/p>\n<\/div>\n<h3>Step 2: Installing Latest MySQL Version<\/h3>\n<p><strong>5.<\/strong>&nbsp;Install latest version of&nbsp;<strong>MySQL<\/strong>&nbsp;(currently&nbsp;<strong>8.0<\/strong>) using the following command.<\/p>\n<pre># yum install mysql-community-server\n# dnf install mysql-community-server      [On <strong>Fedora<\/strong> versions]\n<\/pre>\n<p>The above command installs all the needed packages for MySQL server&nbsp;<strong>mysql-community-server<\/strong>,&nbsp;<strong>mysql-community-client<\/strong>,&nbsp;<strong>mysql-community-common<\/strong>&nbsp;and&nbsp;<strong>mysql-community-libs<\/strong>.<\/p>\n<h3>Step 3: Installing MySQL Release Series<\/h3>\n<p><strong>6.<\/strong>&nbsp;You can also install different MySQL version using different sub-repositories of MySQL Community Server. The sub-repository for the recent MySQL series (currently&nbsp;<strong>MySQL 8.0<\/strong>) is activated by default, and the sub-repositories for all other versions (for example, the MySQL 5.x series) are deactivated by default.<\/p>\n<p>To install specific version from specific sub-repository, you can use&nbsp;<code>--enable<\/code>&nbsp;or&nbsp;<code>--disable<\/code>&nbsp;options using&nbsp;<strong>yum-config-manager<\/strong>&nbsp;or&nbsp;<strong>dnf config-manager<\/strong>&nbsp;as shown:<\/p>\n<pre># yum-config-manager --disable mysql57-community\n# yum-config-manager --enable mysql56-community\n<\/pre>\n<pre>------------------ <strong>Fedora Versions<\/strong> ------------------\n# dnf config-manager --disable mysql57-community\n# dnf config-manager --enable mysql56-community\n<\/pre>\n<h3>Step 4: Starting the MySQL Server<\/h3>\n<p><strong>7.<\/strong>&nbsp;After successful installation of MySQL, it\u2019s time to start the MySQL server with the following command:<\/p>\n<pre># service mysqld start\n<\/pre>\n<p>You can verify the status of the MySQL server with the help of following command.<\/p>\n<pre># service mysqld status\n<\/pre>\n<p>This is the sample output of running MySQL under my CentOS 7 box.<\/p>\n<pre>Redirecting to \/bin\/systemctl status  mysqld.service\nmysqld.service - MySQL Server\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/mysqld.service; enabled)\n   Active: active (running) since Thu 2015-10-29 05:15:19 EDT; 4min 5s ago\n  Process: 5314 ExecStart=\/usr\/sbin\/mysqld --daemonize $MYSQLD_OPTS (code=exited, status=0\/SUCCESS)\n  Process: 5298 ExecStartPre=\/usr\/bin\/mysqld_pre_systemd (code=exited, status=0\/SUCCESS)\n Main PID: 5317 (mysqld)\n   CGroup: \/system.slice\/mysqld.service\n           \u2514\u25005317 \/usr\/sbin\/mysqld --daemonize\n\nOct 29 05:15:19 localhost.localdomain systemd[1]: Started MySQL Server.\n<\/pre>\n<div id=\"attachment_16708\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/02\/Check-Mysql-Status.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-16708\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/02\/Check-Mysql-Status.png\" alt=\"Check Mysql Status\" width=\"720\" height=\"400\" aria-describedby=\"caption-attachment-16708\" data-lazy-loaded=\"true\"><\/a><\/p>\n<p id=\"caption-attachment-16708\" class=\"wp-caption-text\">Check Mysql Status<\/p>\n<\/div>\n<p><strong>8.<\/strong>&nbsp;Now finally verify the installed MySQL version using following command.<\/p>\n<pre># mysql --version\n\n<strong>mysql  Ver 8.0.12 for Linux on x86_64 (MySQL Community Server - GPL)\n<\/strong><\/pre>\n<div id=\"attachment_16707\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/02\/Check-MySQL-Installed-Version.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-16707\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/02\/Check-MySQL-Installed-Version.png\" alt=\"Check MySQL Installed Version\" width=\"720\" height=\"400\" aria-describedby=\"caption-attachment-16707\" data-lazy-loaded=\"true\"><\/a><\/p>\n<p id=\"caption-attachment-16707\" class=\"wp-caption-text\">Check MySQL Installed Version<\/p>\n<\/div>\n<h3>Step 5: Securing the MySQL Installation<\/h3>\n<p><strong>9.<\/strong>&nbsp;The command&nbsp;<strong>mysql_secure_installation<\/strong>&nbsp;allows you to secure your MySQL installation by performing important settings like setting the root password, removing anonymous users, removing root login, and so on.<\/p>\n<p><strong>Note<\/strong>: MySQL version&nbsp;<strong>8.0<\/strong>&nbsp;or higher generates a temporary random password in&nbsp;<code>\/var\/log\/mysqld.log<\/code>&nbsp;after installation.<\/p>\n<p>Use below command to see the password before running mysql secure command.<\/p>\n<pre># grep 'temporary password' \/var\/log\/mysqld.log\n<\/pre>\n<p>Once you know the password you can now run following command to secure your MySQL installation.<\/p>\n<pre># mysql_secure_installation\n<\/pre>\n<p><strong>Note<\/strong>: Enter new Root password means your temporary password from file&nbsp;<code>\/var\/log\/mysqld.log<\/code>.<\/p>\n<p>Now follow the onscreen instructions carefully, for reference see the output of the above command below.<\/p>\n<h5>Sample Output<\/h5>\n<pre>Securing the MySQL server deployment.\n\nEnter password for user root: <strong>Enter New Root Password<\/strong>\n\nVALIDATE PASSWORD PLUGIN can be used to test passwords\nand improve security. It checks the strength of password\nand allows the users to set only those passwords which are\nsecure enough. Would you like to setup VALIDATE PASSWORD plugin?\n\nPress y|Y for Yes, any other key for No: <strong>y<\/strong>\n\nThere are three levels of password validation policy:\n\nLOW    Length &gt;= 8\nMEDIUM Length &gt;= 8, numeric, mixed case, and special characters\nSTRONG Length &gt;= 8, numeric, mixed case, special characters and dictionary                  file\n\nPlease enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: <strong>2<\/strong>\nUsing existing password for root.\n\nEstimated strength of the password: 50 \nChange the password for root ? ((Press y|Y for Yes, any other key for No) : <strong>y<\/strong>\n\nNew password: <strong>Set New MySQL Password<\/strong>\n\nRe-enter new password: <strong>Re-enter New MySQL Password<\/strong>\n\nEstimated strength of the password: 100 \nDo you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : <strong>y<\/strong>\nBy default, a MySQL installation has an anonymous user,\nallowing anyone to log into MySQL without having to have\na user account created for them. This is intended only for\ntesting, and to make the installation go a bit smoother.\nYou should remove them before moving into a production\nenvironment.\n\nRemove anonymous users? (Press y|Y for Yes, any other key for No) : <strong>y<\/strong>\nSuccess.\n\n\nNormally, root should only be allowed to connect from\n'localhost'. This ensures that someone cannot guess at\nthe root password from the network.\n\nDisallow root login remotely? (Press y|Y for Yes, any other key for No) : <strong>y<\/strong>\nSuccess.\n\nBy default, MySQL comes with a database named 'test' that\nanyone can access. This is also intended only for testing,\nand should be removed before moving into a production\nenvironment.\n\nRemove test database and access to it? (Press y|Y for Yes, any other key for No) : <strong>y<\/strong>\n - Dropping test database...\nSuccess.\n\n - Removing privileges on test database...\nSuccess.\n\nReloading the privilege tables will ensure that all changes\nmade so far will take effect immediately.\n\nReload privilege tables now? (Press y|Y for Yes, any other key for No) : <strong>y<\/strong>\nSuccess.\n\nAll done! \n<\/pre>\n<h3>Step 6: Connecting to MySQL Server<\/h3>\n<p><strong>10.<\/strong>&nbsp;Connecting to newly installed MySQL server by providing username and password.<\/p>\n<pre># mysql -u root -p<\/pre>\n<h4>Sample Output:<\/h4>\n<pre>Welcome to the MySQL monitor.  Commands end with ; or \\g.\nYour MySQL connection id is 19\nServer version: <strong>8.0.1<\/strong> MySQL Community Server (GPL)\n\nCopyright (c) 2000, 2015, Oracle and\/or its affiliates. All rights reserved.\n\nOracle is a registered trademark of Oracle Corporation and\/or its\naffiliates. Other names may be trademarks of their respective\nowners.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\nmysql&gt;<\/pre>\n<h3>Step 7: Updating MySQL with Yum<\/h3>\n<p><strong>11.<\/strong>&nbsp;Besides fresh installation, you can also do updates for MySQL products and components with the help of following command.<\/p>\n<pre># yum update mysql-server\n# dnf update mysql-server       [On <strong>Fedora<\/strong> versions]\n<\/pre>\n<div id=\"attachment_16712\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/02\/Update-MySQL-Version.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-16712\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/02\/Update-MySQL-Version.png\" alt=\"Update MySQL Version\" width=\"720\" height=\"400\" aria-describedby=\"caption-attachment-16712\" data-lazy-loaded=\"true\"><\/a><\/p>\n<p id=\"caption-attachment-16712\" class=\"wp-caption-text\">Update MySQL Version<\/p>\n<\/div>\n<p>When new updates are available for MySQL, it will auto install them, if not you will get a message saying&nbsp;<strong>NO packages marked for updates<\/strong>.<\/p>\n<p>That\u2019s it, you\u2019ve successfully installed&nbsp;<strong>MySQL 8.0<\/strong>&nbsp;on your system. If you\u2019re having any trouble installing feel free to use our comment section for solutions.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/install-latest-mysql-on-rhel-centos-and-fedora\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL&nbsp;is an open source free relational database management system (RDBMS) released under GNU (General Public License). It is used to run multiple databases on any single server by providing multi-user access to each created database. This article will walk through you the process of installing and updating latest&nbsp;MySQL 8.0&nbsp;version on&nbsp;RHEL\/CentOS 7\/6\/&nbsp;and&nbsp;Fedora 28-26&nbsp;using&nbsp;MySQL Yum&nbsp;repository via&nbsp;YUM&nbsp;utility. Step &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2023\/01\/23\/how-to-install-latest-mysql-8-0-on-rhel-centos-and-fedora\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Install Latest MySQL 8.0 on RHEL\/CentOS and Fedora&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13898","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13898","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=13898"}],"version-history":[{"count":2,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13898\/revisions"}],"predecessor-version":[{"id":16918,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13898\/revisions\/16918"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=13898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=13898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=13898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}