Installation tutorial of mysql8.0rpm on centos7

Installation tutorial of mysql8.0rpm on centos7

First, download the diagram

1. First uninstall the mariadb that comes with centos7

rpm -qa|grep mariadb //Query the installed mariadb
rpm -e --nodeps file name //Uninstall mariadb, the file name is the file queried by the above command

2. Check whether mysql has been installed

rpm -qa | grep -i mysql

Find the mysql file and delete it using rm -rf mysql file path

find / -name mysql

Delete scattered mysql files

find / -name mysql / # whereis mysql

Deleting a Configuration Document

rm -rf /etc/my.cnf

Check again whether mysql is installed on the machine

rpm -qa|grep -i mysql

3. Install MySQL dependency package (optional)

yum -y install libaio.so.1 libgcc_s.so.1 libstdc++.so.6
yum update libstdc++-4.4.7-4.el6.x86_64
yum search libaio # Retrieve relevant information yum install libaio # Install dependent packages yum install net-tools

4. Unzip MySQL-5.6.40-1.el7.x86_64.rpm-bundle.tar to the mysql directory under /usr/local/ (create the mysql directory manually, mkdir mysql)

tar -xvf MySQL-5.6.40-1.el7.x86_64.rpm-bundle.tar -C /usr/local/mysql

5. Install mysql in /usr/local/mysql. Note that the installation has a sequence and dependencies.

rpm -ivh …common.rpm
rpm -ivh …libs.rpm
rpm -ivh …client.rpm
rpm -ivh …server.rpm

After the installation is complete, the following directory will be generated to store MySQL related files

clip_image002

6. Initialize mysql

mysqld --initialize --user=mysql

After initialization is complete, there will be a random password at the end of the file below. You will use it when you log in later.

cat /var/log/mysqld.log
clip_image004
Cg!hLde4oLG+

6. Start, stop, and restart MySQL

start up:

systemctl start mysqld.service

Start using service: service mysqld start

Start using the mysqld script: /etc/inint.d/mysqld start

Start using safe_mysqld: safe_mysqld&

stop:

Start using service: service mysqld stop

Start using the mysqld script: /etc/inint.d/mysqld stop

mysqladmin shutdown

Restart:

Start using service: service mysqld restart

Start using the mysqld script: /etc/inint.d/mysqld restart

8. Log in to MySQL

mysql -u root -p
clip_image006 

9. Change password (log in to mysql)

alter user 'root'@'localhost' identified by '123456';
clip_image007

In mysql8.0, the alert command must be used to modify it, otherwise the following error will occur:

clip_image008

10. Enable remote login to mysql

After login

show databases;
use mysql;
updata user set host='%' where user = 'root';
select user,host from user;
clip_image009
clip_image010 

11. Firewall Operation

Start a service: systemctl start firewalld.service

Shut down a service: systemctl stop firewalld.service

Restart a service: systemctl restart firewalld.service

Display the status of a service: systemctl status firewalld.service

Enable a service at boot: systemctl enable firewalld.service

Disable a service at boot: systemctl disable firewalld.service

Check whether the service is started: systemctl is-enabled firewalld.service

View the list of started services: systemctl list-unit-files | grep enabled

View the list of services that failed to start: systemctl --failed

12. Port Operation

Add to

firewall-cmd --zone=public --add-port=80/tcp --permanent (--permanent takes effect permanently, and will become invalid after restart without this parameter)

Reload

firewall-cmd –reload

Summarize

The above is the installation tutorial of mysql8.0rpm on centos7 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • How to install MySQL 8.0.13 in Alibaba Cloud CentOS 7
  • Detailed tutorial on installing MySQL 8.0.20 database on CentOS 7
  • Tutorial on installing mysql8 on linux centos7
  • CentOS7.5 installation of MySQL8.0.19 tutorial detailed instructions
  • Tutorial diagram of installing mysql8.0.18 under linux (Centos7)
  • Detailed steps to install MYSQL8.0 on CentOS7.6
  • CentOS7 enables MySQL8 master-slave backup and daily scheduled full backup (recommended)
  • Detailed tutorial on installing MySQL 8.0 from source code on CentOS 7.4
  • Centos7 installation of MySQL8 tutorial

<<:  Detailed explanation of Tomcat configuration and optimization solutions

>>:  Detailed explanation of asynchronous iterators in nodejs

Recommend

Detailed explanation of PHP+nginx service 500 502 error troubleshooting ideas

Overview When a 500 or 502 error occurs during ac...

How to build a standardized vmware image for kubernetes under rancher

When learning kubernetes, we need to practice in ...

A brief analysis of the game kimono memo problem

Today, after the game was restarted, I found that...

Vue scroll down to load more data scroll case detailed explanation

vue-infinite-scroll Install npm install vue-infin...

Steps to build a Docker image using Dockerfile

Dockerfile is a text file that contains instructi...

Several ways to run Python programs in the Linux background

1. The first method is to use the unhup command d...

How to install and configure SSH service in Ubuntu 18.04

Install ssh tool 1. Open the terminal and type th...

MySQL 8.0.11 MacOS 10.13 installation and configuration method graphic tutorial

The process of installing MySQL database and conf...

A simple example of using Vue3 routing VueRouter4

routing vue-router4 keeps most of the API unchang...

Several ways to pass data from parent components to child components in Vue

I have been studying the source code of Vue recen...

How to get form data in Vue

Table of contents need Get data and submit Templa...

Common interview questions and answers for web designer positions

1. What are the templates for ASP.NET Web applicat...

Vue custom component implements two-way binding

Scenario: The interaction methods between parent ...

Complete example of Vue encapsulating the global toast component

Table of contents Preface 1. With vue-cli 1. Defi...