安装mysql rpm -Uvh mysql80-community-release-el7-1.noarch.rpm
查看mysql
yum repolist all | grep mysql
修改mysql80
yum-config-manager --disable mysql80-community
yum-config-manager --enable mysql57-community
如果yum命令没反映 Yum -y install yum-utils
获取临时登录密码:grep 'temporary password' /var/log/mysqld.log
修改密码:ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
重新登陆,开启远程访问GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY 'root' WITH GRANT OPTION;
刷新一下访问权限:FLUSH PRIVILEGES
都成功后用SQLyog登录
出现这种1064错误,手打一次命令:
安装hive:
在官网下载hive,放到xftp的home/hadoop下
解压:tar -xzf .........tar包............ -C opt
进入到conf/
复制hive-default.xml.template这个文件,将其改名为hive-site.xml
Cp hive-default.xml.template hive-site.xml
Vi hive-site.xml 然后敲:/javax.jdo.option.ConnectionURL 回车敲 n
修改:jdbc:mysql://python5:3306/hive?autoReconnect=true&useUnicode=true&createDatabaseIfNotExist=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
(javax.jdo.option.ConnectionDriverName)并修改为(com.mysql.jdbc.Driver)
(javax.jdo.option.ConnectionUserName)
(javax.jdo.option.ConnectionPassword)
查看数据库的储存地址(hive.metastore.warehouse.dir )
配置环境变量:
Cd .. > pwd > hivepath=`pwd` > $hivepath
启动MySQL(schematool -dbType mysql -initSchema)
然后切换到root用户下安装wget
yum -y install wget
切换到hadoop用户下cd opt/apache-hive-2.3.2-bin/lib
下载mysql jar 包
wget http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38.jar
接着执行schematool -dbType mysql -initSchema
最后显示schemaTool comleted 表示成功
启动hadoop
启动hive,更改路径,都换成自己的路径,自己复制通道,新建一个文件hivemp,然后复制这个文件所在的路径home/hadoop/hivemp
Vi hive-site.xml 然后敲 :/system:java.io.tmpdir,更改下的<value>
继续查找
都改完之后输入hive
进入到mysql 中,查看数据库(show databases)mysql -uroot -proot
Show databases; 发现出现了hive 证明hive成功了