本文主要是介绍银河麒麟操作系统 v10 离线安装 mysql 8.4.0,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一 查看系统环境
[root@0003 ~]# cat /etc/os
os-release ostree/
[root@0003 ~]# cat /etc/os-release
NAME="Kylin Linux Advanced Server"
VERSION="V10 (Lance)"
ID="kylin"
VERSION_ID="V10"
PRETTY_NAME="Kylin Linux Advanced Server V10 (Lance)"
ANSI_COLOR="0;31"[root@0003 ~]# uname -a
Linux 0003.novalocal 4.19.90-52.22.v2207.ky10.aarch64 #1 SMP Tue Mar 14 11:52:45 CST 2023 aarch64 aarch64 aarch64 GNU/Linux[root@0003 ~]# ls -l /lib64/libc.so.6
lrwxrwxrwx 1 root root 12 9月 5 2022 /lib64/libc.so.6 -> libc-2.28.so
二 官网下载:MySQL :: Download MySQL Community Server
三 政务云 银河麒麟服务器 通过堡垒机 文件上传
#卸载默认 mariadb
rpm -qa| grep mariadb
mariadb-server-10.3.9-12.p01.ky10.aarch64
mariadb-common-10.3.9-12.p01.ky10.aarch64
mariadb-connector-c-3.0.6-8.ky10.aarch64
mariadb-10.3.9-12.p01.ky10.aarch64
mariadb-errmessage-10.3.9-12.p01.ky10.aarch64
#卸载
rpm -qa| grep mariadb|xargs rpm -e --nodeps
#解压tar xvf mysql-8.4.0-1.el8.aarch64.rpm-bundle.tar -C mysql/
#
rpm -ivh mysql-community-client-8.4.0-1.el8.aarch64.rpm mysql-community-client-debuginfo-8.4.0-1.el8.aarch64.rpm mysql-community-client-plugins-8.4.0-1.el8.aarch64.rpm mysql-community-client-plugins-debuginfo-8.4.0-1.el8.aarch64.rpm mysql-community-debuginfo-8.4.0-1.el8.aarch64.rpm mysql-community-debugsource-8.4.0-1.el8.aarch64.rpm mysql-community-devel-8.4.0-1.el8.aarch64.rpm mysql-community-icu-data-files-8.4.0-1.el8.aarch64.rpm mysql-community-libs-8.4.0-1.el8.aarch64.rpm mysql-community-libs-debuginfo-8.4.0-1.el8.aarch64.rpm mysql-community-common-8.4.0-1.el8.aarch64.rpm
#
rpm -ivh mysql-community-server-8.4.0-1.el8.aarch64.rpm
#如果使用不区分大小写,需要在mysql初始化之前配置(⊙﹏⊙)
lower_case_table_names = 1
#启动
systemctl start mysqld
systemctl enable mysqld
#更改root密码
cat /var/log/mysqld.log | grep root@localhost
2024-06-05T00:38:04.023574Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost:9%qbqfC0(d,q
#mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY '密码';
flush privileges;
#创建数据库
create database test default character set utf8mb4 collate utf8mb4_general_ci;
#增加用户
CREATE USER 'test'@'localhost' IDENTIFIED WITH caching_sha2_password BY '密码';
#如果兼容mysql 5.7之前的
create user test@'%' IDENTIFIED WITH mysql_native_password BY '密码';
#数据库访问权限
Grant all privileges on test.* TO 'test'@'%';
这篇关于银河麒麟操作系统 v10 离线安装 mysql 8.4.0的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!