安装mysql

1)安装依赖

yum search libaio  # 检索相关信息

yum install libaio # 安装依赖包

2)检查 MySQL 是否已安装

yum list installed | grep mysql

如果有,就先全部卸载,命令如下:

yum -y remove mysql-libs.x86_64

3)下载 MySQL Yum Repository(yum仓库)

地址为 http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

执行下载

wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

如果提示-bash: wget: 未找到命令,请先执行 yum install wget 安装

4)如果没有wget下载对应的安装包

wget --->yum -y install wget

5)添加 MySQL Yum Repository

添加 MySQL Yum Repository 到你的系统 repository 列表中,执行

yum localinstall mysql-community-release-el7-5.noarch.rpm

6)验证下是否添加成功

yum repolist enabled | grep "mysql.*-community.*"

7) 开始yum安装mysql

yum install mysql-community-server 

8) 开启

systemctl start  mysqld

systemctl status  mysqld 查看状态

9) 验证

mysql

10)创建hive需要的数据库

在mysql上创建hive元数据库,并对hive进行授权

create database if not exists hive_data;

grant all privileges on hive_data.* to 'hive'@'%' identified by 'hive';

grant all privileges on hive_data.* to 'hive'@'localhost' identified by 'hive';

grant all privileges on hive_data.* to 'hive'@'h666' identified by 'hive';

flush privileges;

use hive_data;

你可能感兴趣的:(安装mysql)