概述
下载Repository Setup Package, 地址: https://dev.mysql.com/downloads/repo/yum/
然后上传到CentOS 8 上,进行安装
[root@Centos8x64 amare]# ls -l mysql80*
-rw-r--r--. 1 root root 30388 Nov 28 23:04 mysql80-community-release-el8-1.noarch.rpm
[root@Centos8x64 amare]#
[root@Centos8x64 amare]# yum -y install mysql80-community-release-el8-1.noarch.rpm
Last metadata expiration check: 0:04:33 ago on Sun 29 Nov 2020 07:03:54 AM CST.
Dependencies resolved.
============================================================================================================
Package Architecture Version Repository Size
============================================================================================================
Installing:
mysql80-community-release noarch el8-1 @commandline 30 k
Transaction Summary
============================================================================================================
Install 1 Package
Total size: 30 k
Installed size: 29 k
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : mysql80-community-release-el8-1.noarch 1/1
Verifying : mysql80-community-release-el8-1.noarch 1/1
Installed products updated.
Installed:
mysql80-community-release-el8-1.noarch
Complete!
[root@Centos8x64 amare]#
然后安装mysql及server
[root@Centos8x64 amare]# yum install mysql
Last metadata expiration check: 0:01:41 ago on Sun 29 Nov 2020 07:09:00 AM CST.
Dependencies resolved.
============================================================================================================
Package Arch Version Repository Size
============================================================================================================
Installing:
mysql x86_64 8.0.21-1.module_el8.2.0+493+63b41e36 AppStream 12 M
Installing dependencies:
mariadb-connector-c-config noarch 3.0.7-1.el8 AppStream 13 k
mysql-common x86_64 8.0.21-1.module_el8.2.0+493+63b41e36 AppStream 148 k
Enabling module streams:
mysql 8.0
Transaction Summary
============================================================================================================
Install 3 Packages
Total download size: 12 M
Installed size: 63 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): mariadb-connector-c-config-3.0.7-1.el8.noarch.rpm 16 kB/s | 13 kB 00:00
(2/3): mysql-common-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64.rpm 122 kB/s | 148 kB 00:01
(3/3): mysql-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64.rpm 2.3 MB/s | 12 MB 00:05
------------------------------------------------------------------------------------------------------------
Total 2.0 MB/s | 12 MB 00:05
warning: /var/cache/dnf/AppStream-a520ed22b0a8a736/packages/mariadb-connector-c-config-3.0.7-1.el8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
CentOS-8 - AppStream 1.6 MB/s | 1.6 kB 00:00
Importing GPG key 0x8483C65D:
Userid : "CentOS (CentOS Official Signing Key) <security@centos.org>"
Fingerprint: 99DB 70FA E1D7 CE22 7FB6 4882 05B5 55B3 8483 C65D
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : mariadb-connector-c-config-3.0.7-1.el8.noarch 1/3
Installing : mysql-common-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 2/3
Installing : mysql-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 3/3
Running scriptlet: mysql-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 3/3
Verifying : mariadb-connector-c-config-3.0.7-1.el8.noarch 1/3
Verifying : mysql-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 2/3
Verifying : mysql-common-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 3/3
Installed products updated.
Installed:
mariadb-connector-c-config-3.0.7-1.el8.noarch
mysql-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64
mysql-common-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64
Complete!
[root@Centos8x64 amare]#
[root@Centos8x64 amare]# yum install mysql-server
Last metadata expiration check: 0:03:05 ago on Sun 29 Nov 2020 07:09:00 AM CST.
Dependencies resolved.
============================================================================================================
Package Architecture Version Repository Size
============================================================================================================
Installing:
mysql-server x86_64 8.0.21-1.module_el8.2.0+493+63b41e36 AppStream 22 M
Installing dependencies:
mecab x86_64 0.996-1.module_el8.2.0+493+63b41e36.9 AppStream 393 k
mysql-errmsg x86_64 8.0.21-1.module_el8.2.0+493+63b41e36 AppStream 581 k
protobuf-lite x86_64 3.5.0-7.el8 AppStream 150 k
Transaction Summary
============================================================================================================
Install 4 Packages
Total download size: 23 M
Installed size: 119 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): mecab-0.996-1.module_el8.2.0+493+63b41e36.9.x86_64.rpm 47 kB/s | 393 kB 00:08
(2/4): protobuf-lite-3.5.0-7.el8.x86_64.rpm 106 kB/s | 150 kB 00:01
(3/4): mysql-errmsg-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64.rpm 11 kB/s | 581 kB 00:50
(4/4): mysql-server-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64.rpm 9.5 kB/s | 22 MB 40:01
------------------------------------------------------------------------------------------------------------
Total 10 kB/s | 23 MB 40:02
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : protobuf-lite-3.5.0-7.el8.x86_64 1/4
Installing : mysql-errmsg-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 2/4
Installing : mecab-0.996-1.module_el8.2.0+493+63b41e36.9.x86_64 3/4
Running scriptlet: mecab-0.996-1.module_el8.2.0+493+63b41e36.9.x86_64 3/4
Running scriptlet: mysql-server-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 4/4
Installing : mysql-server-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 4/4
Running scriptlet: mysql-server-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 4/4
ValueError: File context for /var/log/mysql(/.*)? already defined
Verifying : mecab-0.996-1.module_el8.2.0+493+63b41e36.9.x86_64 1/4
Verifying : mysql-errmsg-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 2/4
Verifying : mysql-server-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64 3/4
Verifying : protobuf-lite-3.5.0-7.el8.x86_64 4/4
Installed products updated.
Installed:
mecab-0.996-1.module_el8.2.0+493+63b41e36.9.x86_64
mysql-errmsg-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64
mysql-server-8.0.21-1.module_el8.2.0+493+63b41e36.x86_64
protobuf-lite-3.5.0-7.el8.x86_64
Complete!
[root@Centos8x64 amare]#
启动MySQL服务,并查看状态
[root@Centos8x64 amare]# systemctl start mysqld.service
[root@Centos8x64 amare]# systemctl status mysqld.service
● mysqld.service - MySQL 8.0 database server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled; vendor preset: disabled)
Active: active (running) since Sun 2020-11-29 07:56:01 CST; 16s ago
Process: 38509 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
Process: 38383 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mysqld.service (code=exited, status=0/SUCCE>
Process: 38357 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
Main PID: 38465 (mysqld)
Status: "Server is operational"
Tasks: 39 (limit: 23643)
Memory: 430.7M
CGroup: /system.slice/mysqld.service
└─38465 /usr/libexec/mysqld --basedir=/usr
Nov 29 07:55:58 Centos8x64 systemd[1]: Starting MySQL 8.0 database server...
Nov 29 07:55:58 Centos8x64 mysql-prepare-db-dir[38383]: Initializing MySQL database
Nov 29 07:56:01 Centos8x64 systemd[1]: Started MySQL 8.0 database server.
查看root密码,登录数据库
[root@Centos8x64 mysql]# grep "password" /var/log/mysql/mysqld.log
2020-11-28T23:55:59.071287Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
[root@Centos8x64 mysql]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 8
Server version: 8.0.21 Source distribution
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql>
最后修改密码及权限
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'schina';
Query OK, 0 rows affected (0.00 sec)
mysql> update user set Host='%' where User='root';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql>
最后
以上就是甜美毛衣为你收集整理的CentOS8 下MySQL8.0 yum方式安装的全部内容,希望文章能够帮你解决CentOS8 下MySQL8.0 yum方式安装所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复