• Home
    • English
    • 中文
  • About Us
  • Services
    • SEO Services
    • Website Design Service
  • Projects
  • Docs
  • Blog
    • Affiliate
    • Ecommerce
    • Frontend
    • linux
      • nginx
    • PHP
      • Magento
      • wordpress
    • Python
    • SEO
    • Web
  • Contact Us

Subscribe to Updates

Get the latest creative news from FooBar about art, design and business.

What's Hot

Design a plugin for wordpress woocommerce to display a tab to show attachment download

2024-04-06

TranslatePress v2.6.9 – WordPress Translation Plugin

2023-12-25

A Linux batch script converting pictures to webp format

2023-07-10
Facebook Twitter Instagram
  • 中文
  • English
Facebook Twitter Instagram Pinterest VKontakte
Weilai Tech Weilai Tech
  • Home
    • English
    • 中文
  • About Us
  • Services
    • SEO Services
    • Website Design Service
  • Projects
  • Docs
  • Blog
    • Affiliate
    • Ecommerce
    • Frontend
    • linux
      • nginx
    • PHP
      • Magento
      • wordpress
    • Python
    • SEO
    • Web
  • Contact Us
Weilai Tech Weilai Tech
Home»Uncategorized»How To Install MySQL 8.0 on CentOS/RHEL 7/6 & Fedora 30/29
Uncategorized

How To Install MySQL 8.0 on CentOS/RHEL 7/6 & Fedora 30/29

OxfordBy Oxford2019-10-22No Comments3 Mins Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Install MySQL 8 on CentOS & Fedora
Share
Facebook Twitter LinkedIn Pinterest Email

MySQL 8 is the latest version available for the installation. MySQL is a most popular database server for Linux systems, it also supports a large number of platforms. This tutorial will help you to Install MySQL Server 8.0 Community Edition on CentOS/RHEL 7/6, Fedora 30/29/28 using the package manager.

Step 1 – Setup Yum Repository

First, you need to enable MySQL yum repository in your system provided by MySQL. Execute one of below command as per your operating system version.

### On CentOS/RHEL 7 system ###
rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm

### On CentOS/RHEL 6 system ###
rpm -Uvh https://repo.mysql.com/mysql80-community-release-el6-3.noarch.rpm

### On Fedora 30 system ###
rpm -Uvh https://repo.mysql.com/mysql80-community-release-fc30-1.noarch.rpm

### On Fedora 29 system ###
rpm -Uvh https://repo.mysql.com/mysql80-community-release-fc29-2.noarch.rpm

### On Fedora 28 system ###
rpm -Uvh https://repo.mysql.com/mysql80-community-release-fc28-2.noarch.rpm

Step 2 – Install MySQL Community Server

The MySQL yum repository contains multiple repositories configuration for multiple MySQL versions. So first disable all repositories in mysql repo file.

sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/mysql-community.repo

Then execute one of the followings commands as per your operating system to install MySQL.

yum --enablerepo=mysql80-community install mysql-community-server  ## CentOS & RedHat 
dnf --enablerepo=mysql80-community install mysql-community-server  ## Fedora Systems 

Step 3 – Start MySQL Service

Start the MySQL server using the following command from Linux terminal.

Using SysVinit

service mysqld start

Using Systemd

systemctl start mysqld.service

Step 4 – Find default root Password

With the installation of MySQL 8.0, a temporary password is created for the MySQL root user. You can find the temporary password generated in log files.

grep "A temporary password" /var/log/mysqld.log

Output:

[Note] A temporary password is generated for root@localhost: hosygMikj1+t636

Step 5 – MySQL Post Install Setup

After installing MySQL first time, execute mysql_secure_installation command to secure MySQL server. It will prompt for few question’s, we recommended to say yes ( y ) for each.

mysql_secure_installation
Enter password for user root:

The existing password for the user account root has expired. Please set a new password.

New password:
Re-enter new password:

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

Step 6 – Restart and Enable MySQL Service

The MySQL installation has been successfully completed. Now restart the service and setup autostart on system bootup.

### Using SysVinit
service mysqld restart
chkconfig mysqld on

### Using Systemd
systemctl restart mysqld.service
systemctl enable mysqld.service

Step 7 – Working with MySQL

Now connect mysql database server Linux shell using below command. It will prompt for the password for authentication. On successful login, you will get the MySQL command prompt, where we can execute SQL queries.

mysql -h localhost -u root -p

Install MySQL 8 on CentOS & Fedora

After login, You can use following commands to create a new database, create a user and assign privileges to the user on the database. Change values as per your requirements.

1
2
3
4
5
6
7
8
9
10
11
### CREATE DATABASE
mysql> CREATE DATABASE mydb;
### CREATE USER ACCOUNT
mysql> CREATE USER ‘dbuser’@‘192.168.10.101’ IDENTIFIED BY ‘secret’;
### GRANT PERMISSIONS ON DATABASE
mysql> GRANT ALL ON mydb.* TO ‘dbuser’@‘192.168.10.101’;
###  RELOAD PRIVILEGES
mysql> FLUSH PRIVILEGES;

Congratulation’s! you have successfully installed MySQL server on your system. Use below quick links for basic MySQL tasks.

REF:

How To Install MySQL 8.0 on CentOS 7/6

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Avatar photo
Oxford

Related Posts

nginx multi sub domain proxy

2021-06-05

How TO – Position Text Over an Image

2021-05-24

bootstrapstudio.io

2021-03-25

how to get wordpress theme getmetrix and google speed insight 100 scores?

2021-03-12
Recent Posts
  • Design a plugin for wordpress woocommerce to display a tab to show attachment download
  • TranslatePress v2.6.9 – WordPress Translation Plugin
  • A Linux batch script converting pictures to webp format
  • Hearing aid listed company official website SEO case
  • how to use docker to run php5.6 plus apache
October 2019
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  
« Sep   Nov »
Tags
app branding design digital Docly docs etc faq fix github Helpdesk Image issue magento Manual marketing memecached Photography planing seo sequrity tips Travel ui/ux web WordPress 爬虫
Editors Picks
About Us

Guangzhou Weilai Technology is a foreign trade integrated marketing service provider focusing on Google as the drainage center and marketing self-built website as the carrier.

Email Us: [email protected]
Contact: +86 18676917505

Facebook Pinterest YouTube LinkedIn
Recent Posts
  • Design a plugin for wordpress woocommerce to display a tab to show attachment download
  • TranslatePress v2.6.9 – WordPress Translation Plugin
  • A Linux batch script converting pictures to webp format
  • Hearing aid listed company official website SEO case
  • how to use docker to run php5.6 plus apache
From Flickr
Website Design Case
© 2024 Copyright by Guangzhou Weilai Technology Co.,Ltd..
  • Home
  • About Us
  • SEO Services
  • Website Design Service
  • Projects
  • Blog
  • Contact Us

Type above and press Enter to search. Press Esc to cancel.