Installation and configuration of mysql 8.0.15 under Centos7

Installation and configuration of mysql 8.0.15 under Centos7

This article shares with you the installation and configuration graphic tutorial of MySQL 8.0.15 for your reference. The specific content is as follows

1. Go to the official website and select the MYSQL version under Linux that suits your version.

Follow the numbers on the arrows and perform the operations in sequence to enter the picture below.


Wait for the download to complete. The first step is now complete.

2. Upload the downloaded mysql-8.0.15-el7-x86_64.tar.gz to the Linux system for decompression.

(1) I uploaded this file to the /root/ directory and first checked the files in the /root/ directory. To ensure that this file exists on your system.

cd /root/
ls

(2) Unzip the file.

tar -zxvf mysql-8.0.15-el7-x86_64.tar.gz

Then this directory will be generated under the current /root/ directory.

3. Install mysql.

(1) Install mysql-8.0.15-el7-x86_64 to /usr/local/mysql.

mv mysql-8.0.15-el7-x86_64 /usr/local/mysql //Move the file to the /usr/local/ directory and rename it to mysql

(2) Add the mysql group and user to the system.

groupadd mysql and useradd -r -g mysql mysql

(3) Enter the /usr/local/mysql directory and modify the relevant permissions.

cd /usr/local/mysql //Enter the /usr/local/mysql directory chown -R mysql:mysql ./ //Change the current directory to the mysql user

(4) Initialize MySQL and record the temporary password, which will be used when you log in for the first time.

bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data 
//After running, a temporary password will be generated

The results are as follows

(5) Check whether the my.cnf file is automatically generated during the initialization process.

cd /etc/ //Enter the /etc/ directory ls | grep my.cnf //Check whether there is a my.cnf file. If there is, it will produce results

(6) After the my.cnf file is generated, go to step 8 to modify the information in the my.cnf file.

(7) If my.cnf is not generated during the initialization process, create a new my-defalut.cnf file and copy it to /etc/my.cnf

touch my-defalut.cnf //Create a new file chmod 755 my-defalut.cnf //Give permissions cp my-defalut.cnf /etc/my.cnf //Copy the file to the /etc/ directory and rename it to my.cnf File name

(8) The information in my.cnf is as follows

[mysqld]
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
port=3306
socket=/tmp/mysql.sock
pid-file=/usr/local/mysql/$hostname.pid //Note the small detail, $hostname here is the host name of Linux. Generally, everyone's host name is different.
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

(9) Configure environment variables for MySQL.

vim /etc/profile // Open the profile file.
export MYSQL_HOME
MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/lib:$MYSQL_HOME/bin

(10) Set it as a startup item.

Execute the code one by one.

cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
chmod +x /etc/init.d/mysql //Add executable permissions.
chkconfig --add mysql // Register and start the service

Enter chkconfig --list // Check whether the addition is successful.

Indicates success.

(11) Start the server and log in to MySQL.

service mysql start //Start the server.
mysql -uroot -p //Log in to mysql and then be prompted to enter the password.

Enter the temporary password generated during the initialization process and press Enter. Enter the following page.

This means the installation has been successful.

(12) After entering MySQL, change the password. Otherwise you can't do anything.

alter user 'root'@'localhost' identified by 'your_password';

Then exit; exit, re-enter, and test.

show databases;

At this point, the entire process of installing MySQL version 8.0.15 is over!

Finally, I am just a novice, and I hope you can give me some advice if I have any questions! ! !

Wonderful topic sharing:

MySQL different versions installation tutorial

MySQL 5.7 installation tutorials for various versions

MySQL 5.6 installation tutorials for various versions

mysql8.0 installation tutorials for various versions

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • MySQL 8.0.15 installation and configuration tutorial under Win10
  • MySQL 8.0.15 download and installation detailed tutorial is a must for novices!
  • MySQL 8.0.15 installation and configuration method graphic tutorial under Windows
  • MySQL 8.0.15 installation and configuration method graphic tutorial
  • MySQL 8.0.15 winx64 decompression version installation and configuration method graphic tutorial
  • MySQL 8.0.15 installation graphic tutorial and database basics
  • MySQL 8.0.15 installation and configuration graphic tutorial
  • MySQL 8.0.15 installation and configuration graphic tutorial under Win10
  • MySQL 8.0.15 installation and configuration graphic tutorial and password change under Linux
  • MySQL 8.0.15 version installation tutorial connect to Navicat.list

<<:  JavaScript macrotasks and microtasks

>>:  How to set static IP in CentOS7 on VirtualBox6 and what to note

Recommend

Sqoop export map100% reduce0% stuck in various reasons and solutions

I call this kind of bug a typical "Hamlet&qu...

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

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

Analysis of MySQL query sorting and query aggregation function usage

This article uses examples to illustrate the use ...

...

JavaScript implements the generation of 4-digit random verification code

This article example shares the specific code for...

Detailed process of using vmware to test PXE batch installation server

Table of contents 1. Preparation 1. Prepare the e...

Detailed explanation of Nginx static file service configuration and optimization

Root directory and index file The root directive ...

JavaScript canvas to achieve mirror image effect

This article shares the specific code for JavaScr...

How to install Nginx in CentOS

Official documentation: https://nginx.org/en/linu...

Tutorial on installing jdk1.8 on ubuntu14.04

1. Download jdk download address我下載的是jdk-8u221-li...

Do you know how to optimize loading web fonts?

Just as the title! The commonly used font-family l...