Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and configure mysql 8.0.15 under Centos7

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces how to install and configure mysql 8.0.15 under Centos7. It is very detailed and has a certain reference value. Friends who are interested must read it!

This article shares the mysql 8.0.15 installation and configuration tutorials for your reference. The details are as follows

1. Go to the official website and select the MYSQL version under your own version of linux.

Follow the numbers on the arrow and proceed in turn to enter the following picture.

Wait for the download so that the first step is complete.

two。 Upload the downloaded mysql-8.0.15-el7-x86_64.tar.gz to the linux system for decompression.

(1) I upload this file to the / root/ directory and first check the files in the / root/ directory. To make sure this file is in the system.

Cd / root/ls

(2) decompress the file.

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

This directory will then be generated under the current / root/ directory.

3. Install mysql.

(1) install mysql-8.0.15-el7-x86_64 under / 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 mysql groups and users 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. / modify the current directory to mysql user

(4) mysql initialization operation to record the temporary password, which will be used when logging in for the first time.

Bin/mysqld-- initialize-- user=mysql-- basedir=/usr/local/mysql-- datadir=/usr/local/mysql/data / / A temporary password will be generated after running

The results are as follows

(5) check to see if my.cnf files are automatically generated during initialization.

Cd / etc/ enter ls under / etc/ directory | grep my.cnf / / check whether there is a my.cnf file. If there is, it will produce results.

(6) initialize and generate the my.cnf file, skip to step 8 and modify the information of the my.cnf file.

(7) if no my.cnf is generated during initialization, 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 / / Grant permission 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 of my.cnf is as follows

[mysqld] basedir=/usr/local/mysqldatadir=/usr/local/mysql/dataport=3306socket=/tmp/mysql.sockpid-file=/usr/local/mysql/$hostname.pid / / Note, small details, $hostname here is the hostname of linux. Generally speaking, 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_HOMEMYSQL_HOME=/usr/local/mysqlexport PATH=$PATH:$MYSQL_HOME/lib:$MYSQL_HOME/bin

(10) set to boot self-startup item.

Execute the code in turn.

Cp / usr/local/mysql/support-files/mysql.server / etc/init.d/mysqlchmod + x / etc/init.d/mysql / / add executable permissions. Chkconfig-add mysql / / Registration Startup Service

Enter chkconfig-- list / / to see if the addition is successful.

It means success.

(11) start the server and log in to mysql.

Service mysql start / / start the server. Mysql-uroot-p / / Log in to mysql and prompt for a password.

Enter the temporary password generated during initialization, and then enter. Go to the page.

At this point, the installation has been successful.

(12) after entering mysql, change the password. Or there's nothing you can do.

Alter user 'root'@'localhost' identified by' your_password'

Then exit; exits, re-enters, and tests.

Show databases

At this point, the whole process of installing mysql version 8.0.15 is over!

The above is all the contents of the article "how to install and configure mysql 8.0.15 under Centos7". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report