1. 下载mysql rpm 包
yum localinstall https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm�

2. 安装mysql
yum install mysql-community-server


3. 启动 mysql
systemctl start mysqld.service

4. 获取mysql 生成的随机密码
grep 'A temporary password is generated for root@localhost' /var/log/mysqld.log |tail -1

5. 配置mysql
/usr/bin/mysql_secure_installation,设置密码必须是字母数字和_ -, 否则Ambari密码验证过不去

5. 输入 mysql -u root -p, 验证是否可以登录mysql

6. create ambari 所需要的objects:
create database ambari;
use ambari;
source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql;

7. 配置允许root 远程登录mysql
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '1QAZ2wsx3edc_';
flush privileges;

8. 如果打算共享该数据库给hive, mysql下执行如下操作
create database hive;
CREATE USER 'hive'@'%' IDENTIFIED BY '1QAZ2wsx3edc_';
GRANT ALL PRIVILEGES ON hive.* TO 'hive'@'%' IDENTIFIED BY '1QAZ2wsx3edc_';

网友评论