建议从头用我的博客,如果用外教的文件到 一、9)步骤了,就用他的弄完,数据库不一样,在9步骤前还能继续看我的
rpm -qa | grep mariadb
rpm -e --nodeps [查询出来的内容]
sudo yum localinstall https://repo.mysql.com//mysql80-community-release-el7-5.noarch.rpm
sudo yum install mysql-community-server
systemctl start mysqld.service

输这个解决:
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023

输这个解决:
sudo yum install mysql-server --nogpgcheck
service mysqld status

grep "A temporary password" /var/log/mysqld.log
图片临时码为f0155f&dA4Ne
输密码用手敲不要复制粘贴
mysql –u root -p
然后会弹出下面这个内容在:后面手敲密码就好,输密码的时候看不见
‘
Enter password:f0155f&dA4Ne
ALTER user 'root'@'localhost' IDENTIFIED BY 'Root123!';
现在进入Mysql密码是 Root123!
GRANT all ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
a. 创建一个hivedb数据库:
create database hivedb;
b. 使用数据库mysql:
use mysql;
c. 输入命令看配置
select host, user, authentication_string, plugin from user;

我们需要一个 hiveuser 对应 % 的用户,所以加一个
CREATE USER 'hiveuser'@'%' IDENTIFIED BY 'Root123!';
加好了,查看一下,就有% hiveuser 的用户了
select host, user, authentication_string, plugin from user;

要是太长了串行了可以省略点查看
select host, user from user;

f. 给hiveuser授权一下
GRANT ALL ON *.* TO 'hiveuser'@'%';
g. 手动更新配置:
flush privileges;
链接:https://pan.baidu.com/s/1NBplQ4GYGfsa25aSK7I8OQ?pwd=vzji
提取码:vzji
–来自百度网盘超级会员V6的分享
tar -zvxf /tools/apache-hive-2.3.8-bin.tar.gz -C /training/
cd /training
重命名移动文件夹为hive
mv apache-hive-2.3.8-bin hive
vi ~/.bash_profile
加进去
export HIVE_HOME=/training/hive
export PATH=$PATH:$HIVE_HOME/bin
:wq 保存退出后,更新环境变量文件
source ~/.bash_profile
======================================================================
进入配置文件夹
cd training/hive/conf
复制备份hive-env.sh.template并命名为hive-env.sh
cp hive-env.sh.template hive-env.sh
复制备份hive-default.xml.template并命名为hive-site.xml
cp hive-default.xml.template hive-site.xml
进入文件
vi hive-site.xml
直接键盘敲6000dd,此命令意思是删除6000行,不要复制
6000 dd
如果还没删空,就多来几次6000dd
删空后加入以下内容,注意复制进去的时候不要少了>符号之类的小错误,此文件涉及到之前设置的密码Root123!,如果你不一样,记得改
#Enter the insert mode by pressingi and then copy this code to the file and save and exit using- :wq.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<!-- WARNING!!! This file is auto generated for documentation purposes ONLY! -->
<!-- WARNING!!! Any changes you make to this file will be ignored by Hive. -->
<!-- WARNING!!! You must make your changes in hive-site.xml instead. -->
<!-- Hive Execution Parameters -->
<property>
<name>hive.default.fileformat</name>
<value>TextFile</value>
</property>
<property>
<!--The port is changed to your own port. Here is the onhive database in the connection database. If not, create it later -->
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost/metastore</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<!--The latest version of the jar package to connect to MySQL All write com.mysql.cj.jdbc.Driver, if it is the old version with com.mysql.jdbc.Driver-->
<value>com.mysql.cj.jdbc.Driver</value>
<description>Driver class name for a JDBC metastore</description>
</property>
<property>
<!--Connect to MySQL username-->
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
<description>username to use against metastore database</description>
</property>
<property>
<!--Connect MySQL password -->
<name>javax.jdo.option.ConnectionPassword</name>
<value>Root123!</value>
<description>password to use against metastore database</description>
</property>
</configuration>
进入文件
vi hive-env.sh
在文件最底下加,注意hadoop版本和java版本以及路径是否和我一样,不一样记得换
export HADOOP_HOME=/training/hadoop-3.3.0
export HIVE_CONF_DIR=/training/hive/conf
export HIVE_AUX_JARS_PATH=/training/hive/lib
export JAVA_HOME=/training/jdk1.8.0_144
export HIVE_HOME=/training/hive
链接:https://pan.baidu.com/s/1gD2M8Gr9IFOkOA4EghfWLg?pwd=32r8
提取码:32r8
–来自百度网盘超级会员V6的分享

找到这个瓜娃27,把它下载到桌面上留着


把瓜娃27放进去,并且删除这个瓜娃14

start-all.sh
cd /training/hive/scripts/metastore/upgrade/mysql/
输入命令后输密码Root123!进入mysql
mysql -u root –p
输命令创建数据库metastore
create database metastore;
使用之前创建好的hivedb
use hivedb;
执行下面的代码
source hive-schema-2.3.0.mysql.sql
schematool -dbType mysql -initSchema
成功的话会有这个提示
Starting metastore schema initialization to 2.3.8 Initialization
script hive-schema-2.3.8.mysql.sql Initialization script completed
schemaTool completed
进hive命令行
hive
创建库
Create database hive1;
显示库,可以看到hive1
Show databases;
退出
exit;
hdfs dfs -ls /user/hive/warehouse

关掉hadoop
stop-all.sh