sudo yum install libaio # 安装依赖包

9.centos7 安装mysql

 

检查 MySQL 是否已安装 

sudo yum list installed | grep mysql

也可以通过命令

rpm -qa|grep -i mysql

 

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

sudo yum -y remove mysql-libs.x86_64

 

wget下载

 sudo yum -y install wget

9.centos7 安装mysql

 

 

执行下载

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

 9.centos7 安装mysql

 

 

添加 MySQL Yum Repository

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

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

9.centos7 安装mysql

 

 

验证下是否添加成功

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

 9.centos7 安装mysql

 

 

开始yum安装mysql

yum install mysql-community-server

 9.centos7 安装mysql

 

 开启

[hadoop@node1 ~]$ sudo systemctl start  mysqld
[hadoop@node1 ~]$ sudo systemctl status  mysqld 

 

9.centos7 安装mysql

 

 初次用root登录没有密码直接回车即可

9.centos7 安装mysql

 

 给root设置密码

9.centos7 安装mysql

 

 set password for 'root'@'localhost' =password('root');

 

 

 

mysql配置文件为/etc/my.cnf

最后加上编码配置

[mysql]
default-character-set =utf8

 

 

把在所有数据库的所有表的所有权限赋值给位于所有IP地址的root用户

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

 

9.centos7 安装mysql

 

 

 

创建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'@'node1' identified by 'hive';

flush privileges;

use hive_metadata;

9.centos7 安装mysql

 

 

通过可视化软件来连接Mysql

9.centos7 安装mysql

 

9.centos7 安装mysql

9.centos7 安装mysql

 

 9.centos7 安装mysql

 

相关文章:

  • 2021-09-20
  • 2021-08-15
  • 2021-07-16
猜你喜欢
  • 2021-11-15
  • 2021-11-20
  • 2021-11-20
  • 2021-11-20
  • 2022-01-07
相关资源
相似解决方案