{"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

Welcome to our guide on how to install MySQL 8 on Fedora 30\/Fedora 29. Check what is new in MySQL 8<\/a> for a number of features that it brings about.<\/p>\n\n\n\n

Install MySQL 8 on Fedora 30\/Fedora 29<\/h2>\n\n\n\n

Before you can begin your installation, run system update to resynchronize packages to their latest versions.<\/p>\n\n\n\n

dnf update\ndnf upgrade<\/code><\/pre>\n\n\n\n

Add MySQL YUM Repository<\/h3>\n\n\n\n

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

On Fedora 30<\/h4>\n\n\n\n
dnf install https:\/\/repo.mysql.com\/\/mysql80-community-release-fc30-1.noarch.rpm<\/code><\/pre>\n\n\n\n

On Fedora 29<\/h4>\n\n\n\n
dnf install https:\/\/repo.mysql.com\/\/mysql80-community-release-fc29-2.noarch.rpm<\/code><\/pre>\n\n\n\n

Install MySQL 8 on Fedora 30\/Fedora 29<\/h3>\n\n\n\n

Once the repositories are installed, you can now install MySQL 8 by executing the command below;<\/p>\n\n\n\n

dnf install mysql-community-server<\/code><\/pre>\n\n\n\n

Running MySQL 8<\/h3>\n\n\n\n

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

systemctl start mysqld\nsystemctl enable mysqld<\/code><\/pre>\n\n\n\n

Extract root User Password<\/h3>\n\n\n\n

When run initially, MySQL server is initialized, SSL certificate and key files are generated in the data directory, 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

grep -i \"temporary password\" \/var\/log\/mysqld.log<\/code><\/pre>\n\n\n\n

You should see a line with a password for root user similar to the one below;<\/p>\n\n\n\n

2019-06-20T09:06:44.132478Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: IAjfHuqme8&.<\/strong><\/code><\/pre>\n\n\n\n

The password in this case is; IAjfHuqme8&.<\/strong><\/p>\n\n\n\n

Change MySQL root Password<\/h3>\n\n\n\n

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

Note that, since the 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

mysql -u root -p\nEnter password: IAjfHuqme8&.<\/strong><\/code><\/pre>\n\n\n\n

Use the temporary password extracted above.<\/p>\n\n\n\n

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

Next, run the command below to reset the password.<\/p>\n\n\n\n

ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyStr0ngPassword#8';<\/code><\/pre>\n\n\n\n

MySQL Installation security<\/h3>\n\n\n\n

Next, you can run initial MySQL security using the 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

mysql_secure_installation<\/code><\/pre>\n\n\n\n

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

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

To confirm that you are running MySQL 8 on Fedora 30\/Fedora 29, login to MySQL and execute the command, SELECT version();<\/code><\/p>\n\n\n\n

mysql -u root -p<\/code><\/pre>\n\n\n\n
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

Well, you are now running MySQL 8.0.16 on Fedora 30\/Fedora 29. Enjoy;<\/p>\n\n\n\n

Other related guides;<\/p>\n\n\n\n

Install LAMP Stack on Fedora 30<\/a><\/p>\n\n\n\n

How To Install LAMP (Linux, Apache, MySQL, PHP) Stack on Fedora 28\/29<\/a><\/p>\n\n\n\n

Install MariaDB 10.3 on CentOS 7<\/a><\/p>\n\n\n\n

Install MariaDB 10.3 on Fedora 30<\/a><\/p>\n\n\n\n

Install phpMyAdmin with Apache on Fedora 30<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

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}]}}