centos7安装mysql

来源:互联网 发布:知乎注册 不用手机号 编辑:程序博客网 时间:2024/06/03 19:31

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安装 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_metadata;

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;

use hive_metadata;

原创粉丝点击