[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
初始化数据库
进入bin目录
schematool -dbType mysql -initSchema
进入hive
hive>create database hive_1;
create table test;
查询
hadoop fs -lsr /
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)