我是靠谱客的博主 碧蓝保温杯,最近开发中收集的这篇文章主要介绍云服务器(arrach64架构)-安装ARM mysql,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

云服务器--安装mysql

    • 云服务器基本配置信息:
    • 安装步骤:

云服务器 arrach64架构 安装mysql数据库

云服务器基本配置信息:

+傲徕操作系统(EulixOS)是由中科院软件所/深圳系统软件研究院(筹)团队
+基于 openEuler(openEuler操作系统关键特性、已知问题及已修复问题介绍)打造的操作系统发行版。
+
即它是一款开源操作系统,且基于 openEuler 进行二次开发。
+当前 EulixOS 内核源于 Linux,支持鲲鹏及其它多种处理器,能够充分释放计算芯片的潜能,
+是由全球开源贡献者构建的高效、稳定、安全的开源操作系统,适用于数据库、大数据、云计算、人工智能等应用场景。
申请的云服务器: 分发区域杭州Z2
1.操作系统:EulixOS 1.0.1 for ARM(傲徕操作系统)
****系统架构:AArch64****
2.TaiShan 200服务器 2280
3.cpu:8cores
4.内存:16GB
5.硬盘:200G

‘’'问题:云服务器上环境搭配不完善,缺少mysql数据库服务

解决思路:[以终为始],参考文档资料安装MySQL’‘’

安装步骤:

(1).先分析云服务器环境:
-操作系统:EulixOS 1.0.1 for ARM(傲徕操作系统)
-系统架构:AArch64
-根据CPU的架构,再去下载对应版本的mysql安装包
(2).先查看CPU的架构是x86或ARM
指令:uname -m
指令:lscpu
查询得知本次云服务器处理器架构是aarch64,属于ARM
(3).根据自己的架构,下载对应操作系统版本的MySQL安装包:(直接下载最大.tar压缩包,rpm依赖包全)
+官方下载地址:https://dev.mysql.com/downloads/mysql/
本次下载ARM版本的安装包。
(4).将安装包通过xftp上传到云服务器指定目录下,并解压(/root)
+tar -xvf mysql-8.0.29-1.el8.aarch64.rpm-bundle.tar
解压后会得到以下几个rpm文件:
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.28-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
(5).依次解压rpm文件(common、libs、client、server)
+ ****************************
+ 安装顺序:仅参考,便于理解
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
-如果安装rpm文件报错,可以在命令末尾加上 --nodeps --force
(忽略依赖环境进行安装)
-****************************
安装成功:
-安装完成后,会自动生成 /etc/my.cnf 配置文件
-安装了 mysql-community-server 组件,会:
a). 在 /etc/下生成 my.cnf 文件 和 my.cnf.d 文件夹
b). 在/var/lib/下生产以下三个文件夹
c). 在/var/log/ 下生成 mysqld.log 文件
d). 在/var/run/ 下生成 mysqld 目录
原文链接:https://blog.csdn.net/lqzixi/article/details/123260293
(6).查看安装是否完成,参考已下文档:
-[root@localhost rootftp]# cat /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
(7).启动mysql
-# systemctl start mysqld
启动mysql服务
-# systemctl status mysqld
查看mysql服务状态
此命令执行后应该返回如下:active(running)状态为绿色
输入指令后的系统显示信息如下:
+ *****************************
[root@localhost rootftp]# systemctl status mysqld
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor pres>
Active: active (running) since Thu 2022-03-03 04:46:34 EST; 20s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 41027 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=>
Main PID: 41061 (mysqld)
Status: "Server is operational"
Tasks: 38 (limit: 23385)
Memory: 471.0M
CGroup: /system.slice/mysqld.service
└─41061 /usr/sbin/mysqld
Mar 03 04:46:27 localhost.localdomain systemd[1]: Starting MySQL Server...
Mar 03 04:46:34 localhost.localdomain systemd[1]: Started MySQL Server.
+ *******************************
(8).查看密码
+[root@localhost rootftp]# grep 'temporary password' /var/log/mysqld.log
# 执行成功回显信息附带了临时密码,显示如下:
-2022-03-03T07:10:39.887374Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: U<=VsitGY83w
# 其中,最末尾的字符串“U<=VsitGY83w”即为安装生成的临时密码,供修改密码使用
U<=VsitGY83w
# 执行成功回显信息附带了临时密码,显示如下:
(9).修改密码
输入:mysql -uroot -p
输入:临时密码U<=VsitGY83w
+ “mysql>”提示符表示安装成功,并已经唤醒进入到mysql,首次应该执行下一条命令来修改root管理密码
+ ********************************************************
-9.1
-ALTER USER 'root'@'localhost' identified by '你的新密码';
-Enter password:
#这里要求的密码要输入上面查出来的临时密码
-如果出现错误,如:
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
”或“
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
-9.2
-mysql> ALTER USER 'root'@'localhost' identified by '12345678Aa?';
# 使用alter语句重置密码
Query OK, 0 rows affected (0.00 sec)
-9.3
-mysql> flush privileges;
# 设置全局权限
Query OK, 0 rows affected (0.00 sec)
-9.4
-mysql> show variables like 'validate_password%';
# 查看密码变量规则
+--------------------------------------+--------+
| Variable_name
| Value
|
+--------------------------------------+--------+
| validate_password.check_user_name
| ON
|
| validate_password.dictionary_file
|
|
| validate_password.length
| 8
|
| validate_password.mixed_case_count
| 1
|
| validate_password.number_count
| 1
|
| validate_password.policy
| MEDIUM |
| validate_password.special_char_count | 1
|
+--------------------------------------+--------+
7 rows in set (0.01 sec)
-9.5
-mysql> set global validate_password.length=4;
# 设置密码长度
密码长度改成4
Query OK, 0 rows affected (0.00 sec)
-9.6
-mysql> set global validate_password.policy=0;
# 设置密码强度, 0简单
1难
密码校验强度改成LOW后,只校验密码长度
Query OK, 0 rows affected (0.00 sec)
-9.7
-mysql> SHOW VARIABLES LIKE 'validate_password%';
# 查看密码变量规则信息
+--------------------------------------+-------+
| Variable_name
| Value |
+--------------------------------------+-------+
| validate_password.check_user_name
| ON
|
| validate_password.dictionary_file
|
|
| validate_password.length
| 4
|
| validate_password.mixed_case_count
| 1
|
| validate_password.number_count
| 1
|
| validate_password.policy
| LOW
|
| validate_password.special_char_count | 1
|
+--------------------------------------+-------+
7 rows in set (0.00 sec)
-9.8
-mysql> ALTER USER 'root'@'localhost' identified by '新密码';
# 设置mysql登录密码
Query OK, 0 rows affected (0.00 sec)
- 9.9
-mysql> exit
# 退出mysql
Bye
-9.10
-[root@192 home]# mysql -u root -p1234
# 登录mysql程序
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.
Commands end with ; or g.
Your MySQL connection id is 13
Server version: 8.0.23 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
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.
+ ********************************************************
(10).设置开机启动
+ [root@192 home]# systemctl enable mysqld
# 安装完并已经修改完mysql密码以后,最好是把mysqld服务重启一下,以下为centOS9 Stream操作命令,centOS8类似,其他版本系统自己查命令
+systemctl stop mysqld
+systemctl start mysqld
+systemctl status mysqld

最后

以上就是碧蓝保温杯为你收集整理的云服务器(arrach64架构)-安装ARM mysql的全部内容,希望文章能够帮你解决云服务器(arrach64架构)-安装ARM mysql所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(31)

评论列表共有 0 条评论

立即
投稿
返回
顶部