





















[root@lab10 ~]# getconf GNU_LIBC_VERSION
glibc 2.17
[root@lab10 ~]# ldd --version
ldd (GNU libc) 2.17
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
[root@lab10 ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[root@lab10 ~]# ip address show ens32
2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:ec:f2:1b brd ff:ff:ff:ff:ff:ff
inet 10.1.1.10/24 brd 10.1.1.255 scope global ens32
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:feec:f21b/64 scope link
valid_lft forever preferred_lft forever
[root@lab10 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@lab10 ~]# getenforce
Permissive
[root@lab10 ~]# rpm -qa|grep mariadb
mariadb-libs-5.5.68-1.el7.x86_64
[root@lab10 ~]# yum remove -y mariadb-libs
yum install -y libaio-devel
centos 8系统才需要进行操作修改)[root@xiaoQ-01 ~]# ln -s /usr/lib64/libncurses.so.6 /usr/lib64/libncurses.so.5
或者
[root@xiaoQ-01 ~]# yum install ncurses-compat-libs
Product Version:
8.2.0
Operating System:Red Hat Enterprise Linux / Oracle Linux
OS Version:Red Hat Enterprise Linux 7 / Oracle Linux 7 (x86, 64-bit)
选择RPM Bundle下载
下载链接如下:https://downloads.mysql.com/archives/get/p/23/file/mysql-8.2.0-1.el7.x86_64.rpm-bundle.tar
文件全称:mysql-8.2.0-1.el7.x86_64.rpm-bundle.tar
文件md5:7c2483e3d1eaa245746f4769bf4f54c5
mkdir -p /opt/mysql
mkdir -p /opt/mysql/mysql-8.2.0
使用工具上传 MySQL
或者
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-8.2.0-1.el7.x86_64.rpm-bundle.tar
cd /opt/mysql
tar -xvf mysql-8.2.0-1.el7.x86_64.rpm-bundle.tar -C /opt/mysql/mysql-8.2.0
mv mysql-8.2.0 /usr/local/mysql
useradd -r -s /sbin/nologin mysql
创建一个数据库专用账号mysql(其所属组也为mysql)
cd /usr/local/mysql
[root@lab10 mysql]# ll
total 1029332
-rw-r--r--. 1 7155 31415 16860000 Oct 13 2023 mysql-community-client-8.2.0-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 3617000 Oct 13 2023 mysql-community-client-plugins-8.2.0-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 687048 Oct 13 2023 mysql-community-common-8.2.0-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 549736120 Oct 13 2023 mysql-community-debuginfo-8.2.0-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 1963108 Oct 13 2023 mysql-community-devel-8.2.0-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 4217572 Oct 13 2023 mysql-community-embedded-compat-8.2.0-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 2344832 Oct 13 2023 mysql-community-icu-data-files-8.2.0-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 1583436 Oct 13 2023 mysql-community-libs-8.2.0-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 685776 Oct 13 2023 mysql-community-libs-compat-8.2.0-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 67735456 Oct 13 2023 mysql-community-server-8.2.0-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 26028560 Oct 13 2023 mysql-community-server-debug-8.2.0-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 378554428 Oct 13 2023 mysql-community-test-8.2.0-1.el7.x86_64.rpm
rpm -ivh mysql-community-common-8.2.0-1.el7.x86_64.rpm \
mysql-community-client-plugins-8.2.0-1.el7.x86_64.rpm \
mysql-community-libs-8.2.0-1.el7.x86_64.rpm \
mysql-community-client-8.2.0-1.el7.x86_64.rpm \
mysql-community-icu-data-files-8.2.0-1.el7.x86_64.rpm \
mysql-community-server-8.2.0-1.el7.x86_64.rpm
[root@lab10 mysql]# mysql -V
mysql Ver 8.2.0 for Linux on x86_64 (MySQL Community Server - GPL)
vim /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove the leading "# " to disable binary logging
# Binary logging captures changes between backups and is enabled by
# default. It's default setting is log_bin=binlog
# disable_log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
#
# Remove leading # to revert to previous value for default_authentication_plugin,
# this will increase compatibility with older clients. For background, see:
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin
# default-authentication-plugin=mysql_native_password
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[mysql]
default-character-set=utf8mb4
[client]
default-character-set=utf8mb4
systemctl start mysqld.service
[root@lab10 mysql]# netstat -ntlp | grep mysql
tcp6 0 0 :::33060 :::* LISTEN 58001/mysqld
tcp6 0 0 :::3306 :::* LISTEN 58001/mysqld
grep "password" /var/log/mysqld.log
内容如下:
2023-09-12T07:56:02.593722Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: kK%N&gY4ro5i
mysql -uroot -p'kK%N&gY4ro5i'
Flzx3qc@ALTER user user() identified by 'Flzx3qc@';
flush privileges;
use mysql;
select host,user,plugin from user;
plugin == caching_sha2_passwordALTER USER 'root'@'localhost' IDENTIFIED WITH sha256_password BY 'Flzx3qc@';
update user set host = '%' where user = 'root';
flush privileges;
plugin == sha256_passwordupdate user set host = '%' where user = 'root';
flush privileges;
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.33 |
+-----------+
1 row in set (0.01 sec)
mysql> show variables like '%character%';
+--------------------------+--------------------------------+
| Variable_name | Value |
+--------------------------+--------------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8mb3 |
| character_sets_dir | /usr/share/mysql-8.0/charsets/ |
+--------------------------+--------------------------------+
8 rows in set (0.01 sec)
mysql>
略
安装参考:https://blog.csdn.net/Controller000/article/details/131121126
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。