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

The whole process record of vue3 recursive component encapsulation

Table of contents Preface 1. Recursive components...

Explanation of several ways to run Tomcat under Linux

Starting and shutting down Tomcat under Linux In ...

In-depth understanding of HTML form input monitoring

Today I saw a blog post about input events, and o...

The difference and usage between div and span

Table of contents 1. Differences and characterist...

Installing the ping tool in a container built by Docker

Because the Base images pulled by Docker, such as...

How to install MySQL for beginners (proven effective)

1. Software Download MySQL download and installat...

13 JavaScript one-liners that will make you look like an expert

Table of contents 1. Get a random Boolean value (...

mysql zip file installation tutorial

This article shares the specific method of instal...

Several methods of implementing carousel images in JS

Carousel The main idea is: In the large container...

Do you know how to use Vue to take screenshots of web pages?

Table of contents 1. Install html2Canvas 2. Intro...

Three common uses of openlayers6 map overlay (popup window marker text)

Table of contents 1. Write in front 2. Overlay to...

HTML web page hyperlink tag

HTML web page hyperlink tag learning tutorial lin...

Very practical Tomcat startup script implementation method

Preface There is a scenario where, for the sake o...