安装依赖
yum search libaio # 检索相关信息
yum -y install libaio # 安装依赖包
检查 MySQL 是否已安装
yum list installed | grep mysql
# 如果有,就全部卸载,命令如下
yum -y remove mysql-libs.x86_64
下载 MySQL yum repository(yum 仓库)
执行下载
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
如果提示-bash: wget: 未找到命令 ,先执行 yum -y install wget ,安装 wget
添加 MySQL yum repository
添加 MySQL yum repository 到你的系统 repository 列表中,执行
yum localinstall mysql-community-release-el7-5.noarch.rpm
验证是否成功
yum repolist enable | grep "mysql.*-community.*"
开始 yum 安装 MySQL
yum install mysql-community-server
开启
systemctl start mysql # 开启
systemctl status mysql # 查看状态
验证
mysql
创建 hive 需要的数据库
在 MySQL 上创建 hive 元数据库,并对 hive 进行授权
# 创建 hive_metadata 数据库
create database if not exists hive_metadata;
# 授权,以 hive 为名称,hive 为密码
grant all privileges on hive_metadata.* to 'hive'@'%' identified by 'hive';
grant all privileges on hive_metadata.* to 'hive'@'localhost' identified by 'hive';
grant all privileges on hive_metadata.* to 'hive'@'s201' identified by 'hive';
# 刷新权限
flush privileges;
# 进入 hive_metadata
use hive_metadata;
完成!
如有错误,欢迎交流!