centos8rpm安装mysql8.0.28
检查
检测系统是否⾃带安装 MySQL
命令如下:
rpm -qa | grep mysql
如果如下存在已安装的包,就需要卸载
mysql-community-client-8.0.18-1.el8.x86_64
mysql-community-libs-8.0.18-1.el8.x86_64
mysql-community-server-8.0.18-1.el8.x86_64
mysql-community-common-8.0.18-1.el8.x86_64
卸载命令
存在mysql已安装的包就需要依次卸载
rpm -e mysql  // 普通删除
rpm -e --nodeps mysql  // 强⼒删除模式,如果使⽤上⾯命令删除时,提⽰有依赖的其它⽂件,则⽤该命令可以对其进⾏强⼒删
查看是否安装了mariadb;
rpm -pa | grep mariadb
如果有安装的话使⽤如下命令移除:
rpm -e XXX
rpm -e --nodeps xxx //强制删除
下载
官⽹地址
下载 centos8 的
mysql-8.0.28-1.el8.x86_64.rpm-bundle.tar
使⽤浏览器⾃带下载功能下载有时候可能会出现因为⽹络等原因包下载不完整⽽出问题的情况(最好下载后校验哈希值),如若正常安装⽼是出问题,推荐使⽤迅雷等下载⼯具下载后校验完毕,使⽤FTP近程传输到服务器安装⽬录。
解压
[root@localhost rootftp]# ls
mysql-8.0.28-1.el8.x86_64.rpm-bundle.tar
mysql-community-client-8.0.28-1.el8.x86_64.rpm
mysql-community-client-debuginfo-8.0.28-1.el8.x86_64.rpm
mysql-community-client-plugins-8.0.28-1.el8.x86_64.rpm
mysql-community-client-plugins-debuginfo-8.0.28-1.el8.x86_64.rpm mysql-community-common-8.0.2
8-1.el8.x86_64.rpm
mysql-community-debuginfo-8.0.28-1.el8.x86_64.rpm
mysql-community-debugsource-8.0.28-1.el8.x86_64.rpm
mysql-community-devel-8.0.28-1.el8.x86_64.rpm
mysql-community-icu-data-files-8.0.28-1.el8.x86_64.rpm
mysql-community-libs-8.0.28-1.el8.x86_64.rpm
mysql-community-libs-debuginfo-8.0.28-1.el8.x86_64.rpm
mysql-community-server-8.0.28-1.el8.x86_64.rpm
mysql-community-server-debug-8.0.28-1.el8.x86_64.rpm
mysql-community-server-debug-debuginfo-8.0.28-1.el8.x86_64.rpm mysql-community-server-debuginfo-8.0.28-1.el8.x86_64.rpm
mysql-community-test-8.0.28-1.el8.x86_64.rpm
mysql-community-test-debuginfo-8.0.28-1.el8.x86_64.rpm
[root@localhost rootftp]#
安装
注意安装顺序
mysql-community-common
三个⼀起装 因为 有依赖
mysql-community-libs-***.rpm
mysql-community-client-***.rpm
mysql-community-client-plugins-***.rpm
mysql-community-server-***.rpm
因为依赖perl ,所以可以直接通过yum⽅式安装
yum install mysql-community-server-****.x86_64.rpm
本⼈采⽤的安装顺序,含最末回车符号批量复制进去可以实现⼀次性批处理安装⾄结束,直接接续配置步骤:
rpm -ivh mysql-community-common-8.0.28-1.el8.x86_64.rpm
rpm -ivh mysql-community-libs-debuginfo-8.0.28-1.el8.x86_64.rpm
rpm -ivh mysql-community-client-plugins-8.0.28-1.el8.x86_64.rpm
rpm -ivh mysql-community-client-plugins-debuginfo-8.0.28-1.el8.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.28-1.el8.x86_64.rpm
rpm -ivh mysql-community-client-8.0.28-1.el8.x86_64.rpm
rpm -ivh mysql-community-debuginfo-8.0.28-1.el8.x86_64.rpm
rpm -ivh mysql-community-client-debuginfo-8.0.28-1.el8.x86_64.rpm
rpm -ivh mysql-community-debugsource-8.0.28-1.el8.x86_64.rpm
rpm -ivh mysql-community-devel-8.0.28-1.el8.x86_64.rpm
rpm -ivh mysql-community-icu-data-files-8.0.28-1.el8.x86_64.rpm
rpm -ivh mysql-community-server-debug-8.0.28-1.el8.x86_64.rpm
rpm -ivh mysql-community-server-debug-debuginfo-8.0.28-1.el8.x86_64.rpm
rpm -ivh mysql-community-server-debuginfo-8.0.28-1.el8.x86_64.rpm
rpm -ivh mysql-community-test-8.0.28-1.el8.x86_64.rpm
rpm -ivh mysql-community-test-debuginfo-8.0.28-1.el8.x86_64.rpm
rpm -ivh mysql-community-server-8.0.28-1.el8.x86_64.rpm
[root@localhost rootftp]# rpm -ivh mysql-community-common-8.0.28-1.el8.x86_64.rpm
warning: mysql-community-common-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29:                           >>>>>>### [100%]
<                          >>>>>>### [100%]
Updating /
1:mysql-community-common-8.0.28-1.e>>>>>>### [100%]
[root@localhost rootftp]# rpm -ivh mysql-community-libs-debuginfo-8.0.28-1.el8.x86_64.rpm
warning: mysql-community-libs-debuginfo-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
error: Failed dependencies:
mysql-community-debuginfo(x86-64) = 8.0.28-1.el8 is needed by mysql-community-libs-debuginfo-8.0.28-1.el8.x86_64
[root@localhost rootftp]# rpm -ivh mysql-community-client-plugins-8.0.28-1.el8.x86_64.rpm
warning: mysql-community-client-plugins-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29:                           >>>>>>### [100%]
<                          >>>>>>### [100%]
Updating /
1:mysql-community-client-plugins-8.>>>>>>### [100%]
[root@localhost rootftp]# rpm -ivh mysql-community-client-plugins-debuginfo-8.0.28-1.el8.x86_64.rpm
warning: mysql-community-client-plugins-debuginfo-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY error: Failed dependencies:
mysql-community-debuginfo(x86-64) = 8.0.28-1.el8 is needed by mysql-community-client-plugins-debuginfo-8.0.28-1.el8.x86_64
[root@localhost rootftp]# rpm -ivh mysql-community-libs-8.0.28-1.el8.x86_64.rpm
warning: mysql-community-libs-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
<                          >>>>>>### [100%]
<                          >>>>>>### [100%]
Updating /
1:mysql-community-libs-8.0.28-1.el8>>>>>>### [100%]
[root@localhost rootftp]# rpm -ivh mysql-community-client-8.0.28-1.el8.x86_64.rpm
warning: mysql-community-client-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29:                           >>>>>>### [100%]
<                          >>>>>>### [100%]mysql下载选x86还是arm
Updating /
1:mysql-community-client-8.0.28-1.e>>>>>>### [100%]
[root@localhost rootftp]# rpm -ivh mysql-community-debuginfo-8.0.28-1.el8.x86_64.rpm
warning: mysql-community-debuginfo-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29:                           >>>>>>### [100
%]
<                          >>>>>>### [100%]
Updating /
1:mysql-community-debuginfo-8.0.28->>>>>>### [100%]
[root@localhost rootftp]# rpm -ivh mysql-community-client-debuginfo-8.0.28-1.el8.x86_64.rpm
warning: mysql-community-client-debuginfo-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
<                          >>>>>>### [100%]
<                          >>>>>>### [100%]
Updating /
1:mysql-community-client-debuginfo->>>>>>### [100%]
[root@localhost rootftp]# rpm -ivh mysql-community-debugsource-8.0.28-1.el8.x86_64.rpm
warning: mysql-community-debugsource-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
<                          >>>>>>### [100%]
<                          >>>>>>### [100%]
Updating /
1:mysql-community-debugsource-8.0.2>>>>>>### [100%]
[root@localhost rootftp]# rpm -ivh mysql-community-devel-8.0.28-1.el8.x86_64.rpm
warning: mysql-community-devel-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
<                          >>>>>>### [100%]
<                          >>>>>>### [100%]
Updating /
1:mysql-community-devel-8.0.28-1.el>>>>>>### [100%]
[root@localhost rootftp]# rpm -ivh mysql-community-icu-data-files-8.0.28-1.el8.x86_64.rpm
warning: mysql-community-icu-data-files-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
<                          >>>>>>### [100%]
<                          >>>>>>### [100%]
Updating /
1:mysql-community-icu-data-files-8.>>>>>>### [100%]
[root@localhost rootftp]# rpm -ivh mysql-community-server-debug-8.0.28-1.el8.x86_64.rpm
warning: mysql-community-server-debug-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
error: Failed dependencies:
mysql-community-server = 8.0.28-1.el8 is needed by mysql-community-server-debug-8.0.28-1.el8.x86_64
[root@localhost rootftp]# rpm -ivh mysql-community-server-debug-debuginfo-8.0.28-1.el8.x86_64.rpm
warning: mysql-community-server-debug-debuginfo-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
<                          >>>>>>### [100%]
<                          >>>>>>### [100%]
Updating /
1:mysql-community-server-debug-debu>>>>>>### [100%]
[root@localhost rootftp]# rpm -ivh mysql-community-server-debuginfo-8.0.28-1.el8.x86_64.rpm
warning: mysql-community-server-debuginfo-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
<                          >>>>>>### [100%]
<                          >>>>>>### [100%]
Updating /
1:mysql-community-server-debuginfo->>>>>>### [100%]
[root@localhost rootftp]# rpm -ivh mysql-community-test-8.0.28-1.el8.x86_64.rpm
warning: mysql-community-test-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
error: Failed dependencies:
mysql-community-server(x86-64) >= 8.0.11 is needed by mysql-community-test-8.0.28-1.el8.x86_64
perl(JSON) is needed by mysql-community-test-8.0.28-1.el8.x86_64
[root@localhost rootftp]# rpm -ivh mysql-community-test-debuginfo-8.0.28-1.el8.x86_64.rpm
warning: mysql-community-test-debuginfo-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
<                          >>>>>>### [100%]
<                          >>>>>>### [100%]
Updating /
1:mysql-community-test-debuginfo-8.>>>>>>### [100%]
[root@localhost rootftp]# rpm -ivh mysql-community-server-8.0.28-1.el8.x86_64.rpm
warning: mysql-community-server-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY
<                          >>>>>>### [100%]
<                          >>>>>>### [100%]
Updating /
1:mysql-community-server-8.0.28-1.e>>>>>>### [100%]
[/usr/lib/tmpfiles.f:1] Line references path below legacy directory /var/run/, updating /var/run/pesign → /run/pesign; please update the tmpfiles.d/ drop [root@localhost rootftp]# yum install mysql-server
Last metadata expiration check: 1:37:35 ago on Thu 03 Mar 2022 03:07:09 AM EST.
Package mysql-community-server-8.0.28-1.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[root@localhost rootftp]# yum install mysql
Last metadata expiration check: 1:37:50 ago on Thu 03 Mar 2022 03:07:09 AM EST.
Package mysql-community-client-8.0.28-1.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
安装完成
安装完成后,会⾃动⽣成 /etc/myf 配置⽂件
安装了 mysql-community-server 组件,会:
a). 在 /etc/下⽣成 myf ⽂件 和 myf.d ⽂件夹
b). 在/var/lib/下⽣产以下三个⽂件夹
c). 在/var/log/ 下⽣成 mysqld.log ⽂件
d). 在/var/run/ 下⽣成 mysqld ⽬录
[root@localhost rootftp]# cat /etc/myf
# For advice on how to change settings please see
# sql/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:
# sql/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

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。

发表评论