{"id":3372,"date":"2019-06-20T12:28:57","date_gmt":"2019-06-20T09:28:57","guid":{"rendered":"https:\/\/kifarunix.com\/?p=3372"},"modified":"2019-06-20T12:28:58","modified_gmt":"2019-06-20T09:28:58","slug":"install-mysql-8-on-fedora-30-fedora-29","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-mysql-8-on-fedora-30-fedora-29\/","title":{"rendered":"Install MySQL 8 on Fedora 30\/Fedora 29"},"content":{"rendered":"\n<p>Welcome to our guide on how to install MySQL 8 on Fedora 30\/Fedora 29. Check <a rel=\"noreferrer noopener\" aria-label=\"what is new in MySQL 8 (opens in a new tab)\" href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/mysql-nutshell.html\" target=\"_blank\">what is new in MySQL 8<\/a> for a number of features that it brings about.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install MySQL 8 on Fedora 30\/Fedora 29<\/h2>\n\n\n\n<p>Before you can begin your installation, run system update to resynchronize packages to their latest versions.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf update\ndnf upgrade<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Add MySQL YUM Repository<\/h3>\n\n\n\n<p>To install MySQL 8 on Fedora 30\/Fedora 29, you need to add MySQL YUM repository. Hence, install the repositories as shown below;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">On Fedora 30<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install https:\/\/repo.mysql.com\/\/mysql80-community-release-fc30-1.noarch.rpm<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">On Fedora 29<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install https:\/\/repo.mysql.com\/\/mysql80-community-release-fc29-2.noarch.rpm<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install MySQL 8 on Fedora 30\/Fedora 29<\/h3>\n\n\n\n<p>Once the repositories are installed, you can now install MySQL 8 by executing the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install mysql-community-server<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Running MySQL 8<\/h3>\n\n\n\n<p>Once the installation is done, you can start and enable MySQL 8 to run on system boot by running the commands below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl start mysqld\nsystemctl enable mysqld<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Extract root User Password<\/h3>\n\n\n\n<p>When run initially, MySQL server is initialized, SSL certificate and key files are generated in the data directory, <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/validate-password.html\" target=\"_blank\" rel=\"noopener\"><code>validate_password<\/code><\/a>\u00a0is installed and enabled and a password for the root user is set and stored in the error log file. To extract the password, use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>grep -i \"temporary password\" \/var\/log\/mysqld.log<\/code><\/pre>\n\n\n\n<p>You should see a line with a password for root user similar to the one below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>2019-06-20T09:06:44.132478Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: <strong>IAjfHuqme8&amp;.<\/strong><\/code><\/pre>\n\n\n\n<p>The password in this case is; <strong>IAjfHuqme8&amp;.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Change MySQL root Password<\/h3>\n\n\n\n<p>As a security measure, ensure that you change the password as soon as possible. Login as root user with the temporary generated password that you extract above.<\/p>\n\n\n\n<p>Note that, since the <strong>validate_password<\/strong> policy is enabled, your password should contain at least one upper case letter, one lower case letter, one digit, and one special character, and that the total password length is at least 8 characters.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql -u root -p\nEnter password: <strong>IAjfHuqme8&amp;.<\/strong><\/code><\/pre>\n\n\n\n<p>Use the temporary password extracted above.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Welcome to the MySQL monitor.  Commands end with ; or \\g.\nYour MySQL connection id is 9\nServer version: 8.0.16\n\nCopyright (c) 2000, 2019, 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.\n\nmysql><\/code><\/pre>\n\n\n\n<p>Next, run the command below to reset the password.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyStr0ngPassword#8';<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">MySQL Installation security<\/h3>\n\n\n\n<p>Next, you can run initial MySQL security using the <strong>mysql_secure_installation<\/strong> script. This scripts helps in setting a password for root user, disable root use remote login, remove anonymous database users, removes test databases.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql_secure_installation<\/code><\/pre>\n\n\n\n<p>Since we have reset the password, login in with your new password. You can as well choose to reset the password or leave the newly created password.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Securing the MySQL server deployment.\n\nEnter password for user root: \nThe 'validate_password' component is installed on the server.\nThe subsequent steps will run with the existing configuration\nof the component.\nUsing existing password for root.\n\nEstimated strength of the password: 100 \nChange the password for root ? ((Press y|Y for Yes, any other key for No) : N\n\n ... skipping.\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) : y\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) : y\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\n\nRemove test database and access to it? (Press y|Y for Yes, any other key for No) : y\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) : y\nSuccess.\n\nAll done!<\/code><\/pre>\n\n\n\n<p>To confirm that you are running MySQL 8 on Fedora 30\/Fedora 29, login to MySQL and execute the command, <code>SELECT version();<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql> SELECT version();\n+-----------+\n| version() |\n+-----------+\n| 8.0.16    |\n+-----------+\n1 row in set (0.00 sec)<\/code><\/pre>\n\n\n\n<p>Well, you are now running MySQL 8.0.16 on Fedora 30\/Fedora 29. Enjoy;<\/p>\n\n\n\n<p>Other related guides;<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-lamp-stack-on-fedora-30\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Install LAMP Stack on Fedora 30<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/how-to-install-lamp-linux-apache-mysql-php-stack-on-fedora-28-29\/\" target=\"_blank\">How To Install LAMP (Linux, Apache, MySQL, PHP) Stack on Fedora 28\/29<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-mariadb-10-3-on-centos-7\/\" target=\"_blank\">Install MariaDB 10.3 on CentOS 7<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-mariadb-10-3-on-fedora-30\/\" target=\"_blank\">Install MariaDB 10.3 on Fedora 30<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-phpmyadmin-with-apache-on-fedora-30\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Install phpMyAdmin with Apache on Fedora 30<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to our guide on how to install MySQL 8 on Fedora 30\/Fedora 29. Check what is new in MySQL 8 for a number of<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[299,121,928,929],"tags":[1000,289,924,135,999],"class_list":["post-3372","post","type-post","status-publish","format-standard","hentry","category-database","category-howtos","category-mariadb","category-mysql","tag-database","tag-fedora-29","tag-fedora-30","tag-mysql","tag-mysql-8","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3372"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=3372"}],"version-history":[{"count":3,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3372\/revisions"}],"predecessor-version":[{"id":3375,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3372\/revisions\/3375"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=3372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=3372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=3372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}