CentOS 7 ARM编译安装MySQL 8.0.30
5
2022-04-03
CentOS 7 ARM编译安装MySQL 8.0.30
1、卸载自带的MariaDB
[root@Nginx-MySQL ~]# rpm -qa | grep mariadb mariadb-libs-5.5.68-1.el7.aarch64 [root@Nginx-MySQL ~]# rpm -e mariadb-libs-5.5.68-1.el7.aarch64 错误:依赖检测失败: libmysqlclient.so.18()(64bit) 被 (已安裝) postfix-2:2.10.1-9.el7.aarch64 需要 libmysqlclient.so.18(libmysqlclient_18)(64bit) 被 (已安裝) postfix-2:2.10.1-9.el7.aarch64 需要 #强制卸载 [root@Nginx-MySQL ~]# rpm -e --nodeps mariadb-libs-5.5.68-1.el7.aarch64 [root@Nginx-MySQL ~]# rpm -qa | grep mariadb
2、下载ARM版本MySQL
访问MySQL官网下载安装包 https://dev.mysql.com/downloads/repo/yum/ 查看Linux发行版[root@Nginx-MySQL ~]# uname -a Linux Nginx-MySQL 5.11.12-300.el7.aarch64 #1 SMP Thu Aug 19 09:02:08 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux


Transmit 是专为mac用户设计的一款功能强大的FTP客户端,Transmit兼容于FTP,SFTP和TLS/SSL协议,提供比Finder更加迅速的iDisk账户接入。与此同时,用户还可以通过Transmit在任意应用程序中无须下载即可实时编辑文档,除此之外,用户还可以通过Transmit 5的标签系统同时进行多处连接,简单快捷的获取目录并使用多种功能。


安装
[root@Nginx-MySQL ~]# ls \ anaconda-ks.cfg log.sh mysql80-community-release-el7-6.noarch.rpm Nginx [root@Nginx-MySQL ~]# yum install -y mysql80-community-release-el7-6.noarch.rpm 已加载插件:fastestmirror Repository base is listed more than once in the configuration Repository updates is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository centosplus is listed more than once in the configuration 正在检查 mysql80-community-release-el7-6.noarch.rpm: mysql80-community-release-el7-6.noarch mysql80-community-release-el7-6.noarch.rpm 将被安装 正在解决依赖关系 --> 正在检查事务 ---> 软件包 mysql80-community-release.noarch.0.el7-6 将被 安装 --> 解决依赖关系完成 依赖关系解决 ================================================================================ Package 架构 版本 源 大小 ================================================================================ 正在安装: mysql80-community-release noarch el7-6 /mysql80-community-release-el7-6.noarch 10 k 事务概要 ================================================================================ 安装 1 软件包 总计:10 k 安装大小:10 k Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction 警告:RPM 数据库已被非 yum 程序修改。 ** 发现 2 个已存在的 RPM 数据库问题, 'yum check' 输出如下: 2:postfix-2.10.1-9.el7.aarch64 有缺少的需求 libmysqlclient.so.18()(64bit) 2:postfix-2.10.1-9.el7.aarch64 有缺少的需求 libmysqlclient.so.18(libmysqlclient_18)(64bit) 正在安装 : mysql80-community-release-el7-6.noarch 1/1 验证中 : mysql80-community-release-el7-6.noarch 1/1 已安装: mysql80-community-release.noarch 0:el7-6 完毕!安装完成后进入yum目录
[root@Nginx-MySQL ~]# cd /etc/yum.repos.d/ [root@Nginx-MySQL yum.repos.d]# ls CentOS-AltArch-7.repo mysql-community.repo CentOS-Base.repo mysql-community-source.repo mysql-community-debuginfo.repo可以看到多了三个有关MySQL的文件,我们来看一下其中的内容
[root@Nginx-MySQL yum.repos.d]# cat ./mysql-community.repo # Enable to use MySQL 5.7 [mysql57-community] name=MySQL 5.7 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql80-community] name=MySQL 8.0 Community Server baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/7/$basearch enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-connectors-community] name=MySQL Connectors Community baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/7/$basearch enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-tools-community] name=MySQL Tools Community baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/7/$basearch enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-tools-preview] name=MySQL Tools Preview baseurl=http://repo.mysql.com/yum/mysql-tools-preview/el/7/$basearch enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-cluster-7.5-community] name=MySQL Cluster 7.5 Community baseurl=http://repo.mysql.com/yum/mysql-cluster-7.5-community/el/7/$basearch enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-cluster-7.6-community] name=MySQL Cluster 7.6 Community baseurl=http://repo.mysql.com/yum/mysql-cluster-7.6-community/el/7/$basearch enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-cluster-8.0-community] name=MySQL Cluster 8.0 Community baseurl=http://repo.mysql.com/yum/mysql-cluster-8.0-community/el/7/$basearch enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql查看可用安装包
[root@Nginx-MySQL ~]# yum list | grep mysql-community Repository base is listed more than once in the configuration Repository updates is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository centosplus is listed more than once in the configuration mysql-community-client.aarch64 8.0.30-1.el7 mysql80-community mysql-community-client-plugins.aarch64 8.0.30-1.el7 mysql80-community mysql-community-common.aarch64 8.0.30-1.el7 mysql80-community mysql-community-devel.aarch64 8.0.30-1.el7 mysql80-community mysql-community-embedded-compat.aarch64 8.0.30-1.el7 mysql80-community mysql-community-icu-data-files.aarch64 8.0.30-1.el7 mysql80-community mysql-community-libs.aarch64 8.0.30-1.el7 mysql80-community mysql-community-libs-compat.aarch64 8.0.30-1.el7 mysql80-community mysql-community-server.aarch64 8.0.30-1.el7 mysql80-community mysql-community-server-debug.aarch64 8.0.30-1.el7 mysql80-community mysql-community-test.aarch64 8.0.30-1.el7 mysql80-community安装
um install –y mysql-community-server报错了
警告:/var/cache/yum/aarch64/7/mysql80-community/packages/mysql-community-client-plugins-8.0.30-1.el7.aarch64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY mysql-community-client-plugins-8.0.30-1.el7.aarch64.rpm 的公钥尚未安装 (1/6): mysql-community-client-plugins-8.0.30-1.el7.aarch64.rpm | 2.5 MB 00:00:02 (2/6): mysql-community-common-8.0.30-1.el7.aarch64.rpm | 645 kB 00:00:00 (3/6): mysql-community-icu-data-files-8.0.30-1.el7.aarch64.rpm | 2.1 MB 00:00:01 (4/6): mysql-community-libs-8.0.30-1.el7.aarch64.rpm | 1.5 MB 00:00:00 (5/6): mysql-community-client-8.0.30-1.el7.aarch64.rpm | 16 MB 00:00:09 (6/6): mysql-community-server-8.0.30-1.el7.aarch64.rpm | 61 MB 00:00:23 -------------------------------------------------------------------------------------------- 总计 2.9 MB/s | 83 MB 00:00:28 从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 检索密钥 获取 GPG 密钥失败:[Errno 14] curl#37 - "Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022"修改文件
[root@Nginx-MySQL ~]# vim /etc/yum.repos.d/mysql-community.repo [mysql80-community] name=MySQL 8.0 Community Server baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/7/$basearch enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql #修改后 [mysql80-community] name=MySQL 8.0 Community Server baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/7/$basearch enabled=1 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql再次执行安装:成功
已安装: mysql-community-server.aarch64 0:8.0.30-1.el7 作为依赖被安装: mysql-community-client.aarch64 0:8.0.30-1.el7 mysql-community-client-plugins.aarch64 0:8.0.30-1.el7 mysql-community-common.aarch64 0:8.0.30-1.el7 mysql-community-icu-data-files.aarch64 0:8.0.30-1.el7 mysql-community-libs.aarch64 0:8.0.30-1.el7 完毕! [root@Nginx-MySQL ~]# mysql -V mysql Ver 8.0.30 for Linux on aarch64 (MySQL Community Server - GPL)
启动MySQL
[root@Nginx-MySQL ~]# systemctl start mysqld [root@Nginx-MySQL ~]# systemctl status mysqld ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since 二 2022-08-02 21:40:06 CST; 9s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 19432 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 19511 (mysqld) Status: "Server is operational" CGroup: /system.slice/mysqld.service └─19511 /usr/sbin/mysqld查看初始密码
[root@Nginx-MySQL ~]# cat /var/log/mysqld.log 2022-08-02T13:40:02.136276Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.30) initializing of server in progress as process 19465 2022-08-02T13:40:02.141175Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2022-08-02T13:40:03.319473Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2022-08-02T13:40:03.975228Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: t>NtGrr2NxeP
A temporary password is generated for root@localhost: t>NtGrr2NxeP加粗的就是初始密码,接下来进行初始化操作
[root@Nginx-MySQL ~]# mysql_secure_installation Securing the MySQL server deployment. #这里输入默认的初始密码:t>NtGrr2NxeP Enter password for user root: The existing password for the user account root has expired. Please set a new password. #输入新密码 New password: #确认新密码 Re-enter new password: The 'validate_password' component is installed on the server. The subsequent steps will run with the existing configuration of the component. Using existing password for root. Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : y New password: Re-enter new password: Estimated strength of the password: 100 #您希望使用提供的密码继续吗? Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y #默认情况下,MySQL 安装有一个匿名用户,允许任何人无需登录 MySQL #为他们创建的用户帐户。 这仅适用于测试,并使安装更顺畅。您应该在进入生产环境之前删除它们 By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. #移除匿名用户? Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Success. #通常,应该只允许 root 从'本地主机'。 这确保了有人无法猜测来自网络的root密码。 Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. #远程禁止root登录? Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Success. #默认情况下,MySQL 带有一个名为“test”的数据库,任何人都可以访问。 这也仅用于测试,并且应该在进入生产之前被删除。 By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. #删除测试数据库并访问它? Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. All done!配置
[root@Nginx-MySQL ~]# ln -sf /usr/local/mysql/my.cnf /etc/my.cnf
- 0
-
分享