前言:
现在看官们对“mysqlrpm安装的位置”大体比较重视,同学们都需要分析一些“mysqlrpm安装的位置”的相关文章。那么小编同时在网摘上搜集了一些对于“mysqlrpm安装的位置””的相关内容,希望大家能喜欢,大家一起来学习一下吧!测试环境安装hive需要安装mysql数据去存储hive的元数据(把hive的数据映射对应的库和表)
现在开始先安装mysql8.0.26:
linux操作系统:RedHat Linux7.9
[root@192 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)
数据库:mysql8.0.26
1、关闭selinux:
setenforce 0
getenforce
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
2、下载mysql软件包
下载地址为
cd /optwget wget [root@192 opt]# lsmysql-community-client-8.0.26-1.el7.x86_64.rpmmysql-community-client-plugins-8.0.26-1.el7.x86_64.rpmmysql-community-common-8.0.26-1.el7.x86_64.rpmmysql-community-devel-8.0.26-1.el7.x86_64.rpmmysql-community-libs-8.0.26-1.el7.x86_64.rpmmysql-community-server-8.0.26-1.el7.x86_64.rpm安装mysql-community-server前,需要先安装下面依赖包: mysql-community-client mysql-community-client-plugins mysql-community-common mysql-community-libs net-tools
3.删除已有的mariadb,防止安装和原有mysql冲突报错
[root@192 opt]# rpm -qa|grep mariadbmariadb-libs-5.5.68-1.el7.x86_64[root@192 opt]# yum remove mariadb-libs -y
4.按顺序安装如下软件包(有依赖关系,按顺序安装,不中会报错)
[root@192 opt]# yum install net-tools libaio-devel -y[root@192 opt]# rpm -ivh mysql-community-common-8.0.26-1.el7.x86_64.rpm [root@192 opt]# rpm -ivh mysql-community-client-plugins-8.0.26-1.el7.x86_64.rpm [root@192 opt]# rpm -ivh mysql-community-libs-8.0.26-1.el7.x86_64.rpm[root@192 opt]# rpm -ivh mysql-community-client-8.0.26-1.el7.x86_64.rpm[root@192 opt]# rpm -ivh mysql-community-server-8.0.26-1.el7.x86_64.rpm这个包安装报错,报错如下:[root@192 opt]# rpm -ivh mysql-community-server-8.0.25-1.el7.x86_64.rpmwarning: mysql-community-server-8.0.25-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEYerror: Failed dependencies: /usr/bin/perl is needed by mysql-community-server-8.0.25-1.el7.x86_64 perl(Getopt::Long) is needed by mysql-community-server-8.0.25-1.el7.x86_64 perl(strict) is needed by mysql-community-server-8.0.25-1.el7.x86_64查看报错是没有安装perl,手动安装perl[root@192 opt]# yum install -y perl-Module-Install.noarch[root@192 opt]# yum install -y perl查看安装的软件包:[root@192 opt]# rpm -qa|grep mysqlmysql-community-libs-8.0.26-1.el7.x86_64mysql-community-client-8.0.26-1.el7.x86_64mysql-community-server-8.0.26-1.el7.x86_64mysql-community-common-8.0.26-1.el7.x86_64mysql-community-client-plugins-8.0.26-1.el7.x86_64
5、初始化并启动MySQL服务
[root@192 opt]# mysqld --initialize-insecure --user=mysql[root@192 opt]# systemctl start mysqld[root@192 opt]# netstat -lntup|grep 330tcp6 0 0 :::33060 :::* LISTEN 27708/mysqld tcp6 0 0 :::3306 :::* LISTEN 27708/mysqld
6.启动并检查端口存在后并登录查看。
[root@192 opt]# mysql -u root -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 10Server version: 8.0.26 MySQL Community Server - GPLCopyright (c) 2000, 2021, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || performance_schema || sys |+--------------------+4 rows in set (0.02 sec)mysql> quitBye
标签: #mysqlrpm安装的位置