解压文件:
tar -zxvf apache-hive-2.0.0-bin.tar.gz
重命名:
mv /usr/local/src/apache-hive-2.0.0-bin /usr/local/src/hive
卸载 MariaDB 数据库:
rpm -qa | grep mariadb
rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_64
安装mysql数据库:
rpm -ivh mysql-community-common-5.7.39-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.39-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.39-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.39-1.el7.x86_64.rpm --nodeps --force
配置文档:
vi /etc/my.cnf
default-storage-engine=innodb
innodb_file_per_table
collation-server=utf8_general_ci
init-connect='SET NAMES utf8'
character-set-server=utf8
启动MySQL:
systemctl start mysqld
查看MySQL状态:
systemctl status mysqld
查看初始密码:
cat /var/log/mysqld.log | grep password
初始化 MySQL 数据库:
mysql_secure_installation
初始密码
Password123$
Password123$
y
Password123$
Password123$
y
y
n
y
y
进入myspl:
mysql -uroot -pPassword123$
添加 root 用户本地访问授权:
grant all privileges on . to root@'localhost' identified by 'Password123$';
添加 root 用户远程访问授权:
grant all privileges on . to root@'%' identified by 'Password123$';
刷新授权:
flush privileges;
查询 root 用户授权情况:
select user,host from mysql.user where user='root';
重启MySQL:
systemctl restart mysqld
配置环境变量:
vi /etc/profile
export HIVE_HOME=/usr/local/src/hive
export PATH=$PATH:$HIVE_HOME/bin
刷新:
source /etc/profile
cd /usr/local/src/hive/conf/
架包:
cp mysql-connector-java-5.1.46.jar /usr/local/src/hive/lib/
stop-all.sh
start-all.sh
初始化数据库:
schematool -initSchema -dbType mysql
进入:
hive
启动hive图形化界面:
hive --service hiveserver2