Mysql
解压 MySQL 安装包
[atguigu @hadoop102 software]# tar -xf mysql-5.7.28-1.el7.x86_64.rpmbundle.tar
安装
rpm -ivh mysql-community-common-5.7.28-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.28-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-5.7.28-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.28-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.28-1.el7.x86_64.rpm
vi /etc/my.cnf
[mysqld] datadir=/var/lib/mysql
删除/var/lib/mysql 目录下的所有内容: [atguigu @hadoop102 mysql]# cd /var/lib/mysql [atguigu @hadoop102 mysql]# sudo rm -rf ./*
//注意执行命令的位置
初始化数据库
mysqld --initialize --user=mysql
如遇异常则
pkill mysqld
pkill mysql
cd /var/lib/
chmod 777 mysql
查看初始密码
cat /var/log/mysqld.log
启动服务
systemctl start mysqld
登录数据库
mysql -u root -p
Enter password: 输入临时生成的密码
修改密码
set password = password("新密码");
update mysql.user set host='%' where user='root';
create database metastore
flush privileges;
hive
解压
tar -zxvf apache-hive-1.2.2- bin.tar.gz
mv apa……/ /usr/local/hive
配置环境变量
vi /etc/profile.d/my_env.sh
export HIVE_HOME=/usr/local/hive
export PATH=$PATH:$HIVE_HOME/bin
解决日志包冲突
rm -rf /usr/local/hadoop/share/hadoop/yarn/lib/j
cp /usr/local/hive/lib/jline-2.12.jar /usr/local/hadoop/share/hadoop/yarn/lib
cd /usr/local/hive/conf
vi hive-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<!-- jdbc 连接的 URL -->
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.10.10:3306/metastore?useSSL=false</value>
</property>
<!-- jdbc 连接的 Driver-->
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<!-- jdbc 连接的 username-->
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
</property>
<!-- jdbc 连接的 password -->
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>123456</value>
</property>
<!-- Hive 元数据存储版本的验证 -->
<property>
<name>hive.metastore.schema.verification</name>
<value>false</value>
</property>
<!--元数据存储授权-->
<property>
<name>hive.metastore.event.db.notification.api.auth</name>
<value>false</value>
</property>
<!-- Hive 默认在 HDFS 的工作目录 -->
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
</property>
</configuration>
初始化数据库
进入bin目录
schematool -dbType mysql -initSchema
进入hive
hive>create database hive_1;
create table test;
查询
hadoop fs -lsr /