CentOS 7 installation and configuration of MySQL 8.0 graphic tutorial

CentOS 7 installation and configuration of MySQL 8.0 graphic tutorial

1. Check the Linux version number:

Insert picture description here

2. Download the installation package required by MySQL 8.0 from the official website

Website: https://dev.mysql.com/downloads/mysql/
Baidu cloud link: https://pan.baidu.com/s/1jnQuCwnQvEa492yHlT4qew Extraction code: bvw9

1. Select Operating System: select Red Hat, CentOS is based on Red Hat, Select OS Version: select linux 7, select RPM Bundle for the following installation package and click Download:

Insert picture description here

2. Click No thanks, just start my download. to download:

Insert picture description here

3. Downloaded:

Insert picture description here

3. Open VMware, select the virtual machine you want to use, click to open this virtual machine to minimize, and open the terminal software mobaxterm, connect to the virtual machine ip, and install mysql 8:

Insert picture description here
Insert picture description here

1. View the installation package of mariadb through the rpm -qa | grep mariadb command

Insert picture description here

2. Use the rpm -e mariadb-libs-5.5.68-1.el7.x86_64 --nodeps command to load and unload mariadb, and then use the rpm -qa | grep mariadb command to check if the mariadb installation package is gone:

Insert picture description here

3. Install mysql 8.0:
(1) Create a mysql user, upload the mysql 8.0 installation package, etc.:
创建用户:
groupadd mysql
useradd -g mysql mysql
passwd mysql

创建文件夹:
mkdir /mysql
chown mysql:mysql /mysql

Insert picture description here

上传mysql rpm包
解压mysql rpm包:
tar -xf mysql-8.0.23-1.el7.x86_64.rpm-bundle.tar
授予可执行权限:chmod -R 777 *

Insert picture description here
Insert picture description here

(2) Start to install mysql. If an error is reported about missing dependent packages, you can add the command --nodeps --force to ignore the forced installation, and install the following rpm packages in turn:
mysql-community-common-8.0.23-1.el7.x86_64.rpm
mysql-community-libs-8.0.23-1.el7.x86_64.rpm
mysql-community-client-8.0.23-1.el7.x86_64.rpm 
mysql-community-server-8.0.23-1.el7.x86_64.rpm

Insert picture description here

(3) Initialize the mysql database after the installation is complete:
初始化mysql数据库:
mysqld --initialize --user=mysql
查看初始随机密码:
cat /var/log/mysqld.log

Check the initial random password, the initial password is A4XyAx41ap!a
Insert picture description here

(4) Start the mysql database:
systemctl start mysqld.service   ##启动mysql数据库服务
systemctl status mysqld.service  ##检查mysql服务状态
systemctl enable mysqld.service  ##允许服务开机启动

Insert picture description here

(5) Log in to mysql and reset the root password:
mysql -u root -p 登录mysql
Enter password: A4XyAx41ap!a (这里的密码就是刚才查的初始随机密码)
mysql>alter user 'root'@'localhost' identified by '123456';
mysql>select version(); 查看mysql版本

Insert picture description here

(6) Here mysql 8 has been installed and configured, log in to mysql with the new password:

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_40220309/article/details/110196498