HIVE安装系列之一:在Linux中安装mysql,为其作为hive的metastore做准备
来源:互联网 发布:程序员职业学历要求 编辑:程序博客网 时间:2024/06/07 22:53
- 安装mysql的Linux机器是Centos6的系统,机器名字叫combanc05
- mysql我采用的是5.5版本。
- 安装过程中需要解决新旧版的冲突问题,并允许mysql被远程访问。以便其作为hive的元数据仓库顺利运行。
- 下载到mysql
在linux中安装mysql,
首先可以到官网去找Linux(Centos6.4)对应的mysql版本,也就是Red Hat对应的版本。下载之后上传到linux文件系统中。
MySQL-client-5.5.31-2.el6.i686
MySQL-server-5.5.31-2.el6.i686
- 解决新旧版本的冲突
只安装server就可以,但是安装client配置起来很方便。
#用 rpm 来安装
命令:rpm -ivh MySQL-server-5.5.31-2.el6.i686
i 安装 instance
v 显示详情
h 显示进度
#用 rpm来显示查询已经安装的旧版本
命令:rpm -qa | grep mysql
命令:rpm -qa | grep MySQL
qa 将所有的rpm包都显示出来。a=all
管道,过滤所有的mysql
#用rpm卸载已经安装的旧版本。
命令:rpm -e mysql-libs-5.1.66-2.el6_3.i686
e=erase 擦除。
error: Failed dependencies:
libmysqlclient.so.16 is needed by (installed) postfix-2:2.6.6-2.2.el6_1.i686
libmysqlclient.so.16(libmysqlclient_16) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.i686
mysql-libs is needed by (installed) postfix-2:2.6.6-2.2.el6_1.i686
报错了,说明有别的包依赖它。
#使用暴力的方式强制删除
命令: rpm -e mysql-libs-5.1.66-2.el6_3.i686 --nodeps
#重新安装一下mysql
命令: rpm -ivh MySQL-server-5.5.31-2.el6.i686
- 将安装好的mysql初始化
---------------------安装成功之后会有这么一段。----------------------------------
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h combanc04 password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation 你可以用这个对mysql进行初始化
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
-----------------------------------------------------------------------------------
#为安装配置方便,我们要将client也安装上去
命令:rpm -ivh MySQL-client-5.5.31-2.el6.i686
#提示用这条命名对mysql进行初始化/usr/bin/mysql_secure_installation
#命令:/usr/bin/mysql_secure_installation
- 初始化之前我们需要先启动mysql server
---------------------初始化的时候会有如下的报错-----------------------------------
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Enter current password for root (enter for none):
Aborting!
----------------------------------------------------------------------------------------
#为了解决这一错误,我们打开mysql安装目录/usr/share/mysql下的mysql.server文件
命令:vim /usr/share/mysql/mysql.server
里面有这样一段话。
# If you install MySQL on some other places than /usr, then you
# have to do one of the following things for this script to work:
#
# - Run this script from within the MySQL installation directory 先这么办,这个是好用的。
# - Create a /etc/my.cnf file with the following information:
# [mysqld]
# basedir=<path-to-mysql-installation-directory>
# - Add the above to any other configuration file (for example ~/.my.ini)
# and copy my_print_defaults to /usr/bin
# - Add the path to the mysql-installation-directory to the basedir variable
# below.
#
# If you want to affect other MySQL variables, you should make your changes
# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.
# If you change base dir, you must also change datadir. These may get
# overwritten by settings in the MySQL configuration files.
basedir=
datadir=
-------------------------------------------------------------------------------------------------- 我们跑到mysql的安装目录里面去启动mysql
#跑到mysql的安装目录
命令: cd /usr/share/mysql
#在/usr/share/mysql下查看mysql是否启动
命令:service mysql status
#在/usr/share/mysql文件夹下启动mysql
命令:service mysql start
- 对mysql进行初始化
要设置root密码为hadoop
要删除匿名用户
记得要允许用户远程连接。
- #在mysql中运行一个授权语句,授权root用户可以在任何主机上访问mysql,用密码hadoop
命令:GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'hadoop' WITH GRANT OPTION;
如果root用户可以在combanc03上访问,则改成 'root'@'combanc03'就可以了。
如果你仅想操作hive库下面的所有表则 *.* 变成hive.*
#在mysql中运行一个授权语句,授权root用户可以在任何主机上访问mysql,用密码hadoop命令:GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'hadoop' WITH GRANT OPTION;
如果root用户可以在combanc03上访问,则改成 'root'@'combanc03'就可以了。
如果你仅想操作hive库下面的所有表则 *.* 变成hive.*
0 0
- HIVE安装系列之一:在Linux中安装mysql,为其作为hive的metastore做准备
- 安装并使用mysql5.7作为hive的metastore
- 使用MYSQL作为HIVE的METASTORE
- Hive 之使用mysql作为hive的metastore
- Hadoop 集群 Hive 部署,安装mysql metastore
- 基于hadoop集群的hive安装 mysql as metastore database
- HIVE 安装系列(3)配置HIVE 使用Mysql作为元数据的数据库
- [Hive] 完全分布式安装过程(MetaStore: MySQL)
- hive系列-hive安装
- 配置HIVE的Metastore为MySQL操作实例
- 搭建hive的环境,以mysql为Metastore
- hive 操作(二)——使用 mysql 作为 hive 的metastore
- Hive学习之配置MySQL为Metastore
- linux中安装hive
- HIVE安装系列之二:配置HIVE(用Mysql作为元数据仓库)
- hive安装过程:metastore(元数据存储)的三种方式之本地mysql方式
- hive安装过程:metastore(元数据存储)的三种方式之远端mysql方式
- 【hive】mysql metastore 配置
- 层级重音分析与预测方法研究
- 深入学习Phaser补间动画
- j2ee中文乱码小结
- UIPinchGestureRecognizer 例子
- 电子现金联机的几种情况
- HIVE安装系列之一:在Linux中安装mysql,为其作为hive的metastore做准备
- iOS中属性与成员变量的区别
- 南阳 兄弟郊游问题
- 最短路径之 Dijkstra模板
- IOS Foundation基础知识
- Python图表绘制:matplotlib绘图库入门
- Android Tween动画之RotateAnimation实现图片不停旋转
- 关于表格凸起和凹下的设计
- SQLITE select 输出限定