Start preparing to install hive2.1.0, the installation of hive involves metadata-metastore storage, hive metadata supports a variety of databases, only the general MySQL database is considered here. First, query the hive2.1.0 related metabase compatibility requirements and visit the Hive wiki site: https://cwiki.apache.org/confluence/display/Hive/AdminManual+ Metastoreadmin, about a minute later, the page finally opened, the database version requires the following table:
postgres mysql ms SQL server
Database |
Minimum supported Version |
Name for Parameter Values |
See Also |
9.1.13 |
postgres |
|
Oracle |
11g |
Oracle |
|
5.6.17 |
|
2008 R2 |
|
As can be seen from the above table, the MySQL version must be 5.6.17, confirm my Linux version and Linux comes with the installed MySQL version, found that the pre-installed MySQL version is too low.
[Email protected] ~]# lsb_release-a LSB Version:: core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64: Printing-4.0-noarch Distributor Id:redhatenterpriseserver description:red Hat Enterprise Linux Server release 6.3 (Santiago) release:6.3 Codename:santiago |
Check out the pre-installed MySQL version:
[[email protected] ~]# rpm-qa|grep-i ' MYSQL ' Qt-mysql-4.6.2-24.el6.x86_64 Mod_auth_mysql-3.0.0-11.el6_0.1.x86_64 Php-mysql-5.3.3-3.el6_2.8.x86_64 Mysql-libs-5.1.61-4.el6.x86_64 Mysql-5.1.61-4.el6.x86_64 Mysql-server-5.1.61-4.el6.x86_64 Mysql-devel-5.1.61-4.el6.x86_64 Mysql-connector-odbc-5.1.5r1144-7.el6.x86_64 Mysql-python-1.2.3-0.3.c1.1.el6.x86_64 Perl-dbd-mysql-4.013-3.el6.x86_64 Rsyslog-mysql-5.8.10-2.el6.x86_64
|
Then downloaded the mysql5.6.17 version from the MySQL website, as shown in the table below, but it seems that the address is now inaccessible.
http://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.17-1.linux_glibc2.5.x86_64.rpm http://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.17-1.linux_glibc2.5.x86_64.rpm http://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-devel-5.6.17-1.linux_glibc2.5.x86_64.rpm
|
The detailed installation procedures for MySQL are described below.
1. Remove the installed MySQL installation package from the Linux system.
[Email protected] ~]#rpm-e qt-mysql-4.6.2-24.el6.x86_64--nodeps [Email protected] ~]#rpm-e mod_auth_mysql-3.0.0-11.el6_0.1.x86_64--nodeps [Email protected] ~]#rpm-e php-mysql-5.3.3-3.el6_2.8.x86_64--nodeps [Email protected] ~]#rpm-e mysql-libs-5.1.61-4.el6.x86_64--nodeps [Email protected] ~]#rpm-e mysql-5.1.61-4.el6.x86_64--nodeps [Email protected] ~]#rpm-e mysql-server-5.1.61-4.el6.x86_64--nodeps [Email protected] ~]#rpm-e mysql-devel-5.1.61-4.el6.x86_64--nodeps [Email protected] ~]#rpm-e mysql-connector-odbc-5.1.5r1144-7.el6.x86_64--nodeps [Email protected] ~]#rpm-e mysql-python-1.2.3-0.3.c1.1.el6.x86_64--nodeps [Email protected] ~]#rpm-e perl-dbd-mysql-4.013-3.el6.x86_64--nodeps [Email protected] ~]#rpm-e rsyslog-mysql-5.8.10-2.el6.x86_64--nodeps |
2, if you have installed MySQL, you need to completely uninstall MySQL, delete residual files.
[Email protected] ~]# rm-rf/usr/my* [Email protected] ~]# Rm/root/.mysql_secret [Email protected] ~]# rm-rf/var/lib/mysql [Email protected] ~]# rm-rf/usr/lib64/mysql |
3. Upload the downloaded installation package to the Linux server and execute the following command in the directory where the RPM package is located:
[Email protected] hadoop]#RPM-IVH mysql-client-5.6.17-1.linux_glibc2.5.x86_64.rpm Preparing ... ########################################### [100%] 1:mysql-client ########################################### [100%] [Email protected] hadoop]#RPM-IVH mysql-devel-5.6.17-1.linux_glibc2.5.x86_64.rpm Preparing ... ########################################### [100%] 1:mysql-devel ########################################### [100%] [Email protected] hadoop]#RPM-IVH mysql-server-5.6.17-1.linux_glibc2.5.x86_64.rpm Preparing ... ########################################### [100%] 1:mysql-server ########################################### [100%] ...... ......
|
4. Determine the installed MySQL installation information
[[email protected] hadoop]# rpm-qa|grep-i ' MySQL ' Mysql-client-5.6.17-1.linux_glibc2.5.x86_64 Mysql-server-5.6.17-1.linux_glibc2.5.x86_64 Mysql-devel-5.6.17-1.linux_glibc2.5.x86_64
|
5, #设置启动服务service, execute the following copy command
[Email protected] hadoop]# cp/usr/share/mysql/mysql.server/etc/init.d/mysqld
|
6. modifying character Set parameters
[Email protected] ~]# vi/usr/my.cnf Add the following lines at the end of the source file
#modify Start 20161103 Character-set-server=utf8 [Client] Default-character-set=utf8 #modify End 20161103 |
7. Restart MySQL Service
[Email protected] ~]# service mysqld Restart Shutting down MySQL. Determine Starting MySQL. Determine |
8. Modify the root user password of the MySQL database
Description: First execute the following command to query the root user random password for MySQL initialization settings [Email protected] ~]# Cat/root/.mysql_secret # The random password set for the root user at Fri Jul 8 01:26:20 (local time): opjshw_zgro6c0uk
#将上面查询到的随机密码作为第二个参数, precede with "-P" [Email protected] ~]#mysql-uroot–popjshw_zgro6c0uk |
9. After entering the MySQL command line, set the new password
mysql> SET PASSWORD = PASSWORD (' 123456 '); Query OK, 0 rows affected (0.07 sec)
|
10. Exit MySQL from the command line and enter MySQL with the newly set password
At this point, the mysql5.6.17 installation is accomplished.
This article from "Shen Jinqun" blog, declined reprint!
Big data: From Getting Started to XX (10)