linux中mysql安裝部署:
1、查看當前的centos系統中有沒有已經安裝的mysql
rpm、yum
[root@hadoop1 ~]# rpm -qa | grep mysql*
mysql-libs-5.1.71-1.el6.x86_64
2、卸載已經安裝mysql
[root@hadoop1 ~]# rpm -e --nodeps mysql-libs-5.1.71-1.el6.x86_64 -->|–nodeps 不依賴
3、安裝mysql
a、查看linux操作系統中有哪些mysql安裝包
[root@hadoop1 ~]# yum list |grep mysql
apr-util-mysql.x86_64 1.3.9-3.el6_0.1 base
bacula-director-mysql.x86_64 5.0.0-13.el6 base
bacula-storage-mysql.x86_64 5.0.0-13.el6 base
dovecot-mysql.x86_64 1:2.0.9-22.el6 base
freeradius-mysql.x86_64 2.2.6-7.el6_9 base
libdbi-dbd-mysql.x86_64 0.8.3-5.1.el6 base
mod_auth_mysql.x86_64 1:3.0.0-11.el6_0.1 base
mysql.x86_64 5.1.73-8.el6_8 base
mysql-bench.x86_64 5.1.73-8.el6_8 base
mysql-connector-java.noarch 1:5.1.17-6.el6 base
mysql-connector-odbc.x86_64 5.1.5r1144-7.el6 base
mysql-devel.i686 5.1.73-8.el6_8 base
mysql-devel.x86_64 5.1.73-8.el6_8 base
mysql-embedded.i686 5.1.73-8.el6_8 base
mysql-embedded.x86_64 5.1.73-8.el6_8 base
mysql-embedded-devel.i686 5.1.73-8.el6_8 base
mysql-embedded-devel.x86_64 5.1.73-8.el6_8 base
mysql-libs.i686 5.1.73-8.el6_8 base
mysql-libs.x86_64 5.1.73-8.el6_8 base
mysql-server.x86_64 5.1.73-8.el6_8 base
mysql-test.x86_64 5.1.73-8.el6_8 base
pcp-pmda-mysql.x86_64 3.10.9-9.el6 base
php-mysql.x86_64 5.3.3-49.el6 base
qt-mysql.i686 1:4.6.2-28.el6_5 base
qt-mysql.x86_64 1:4.6.2-28.el6_5 base
rsyslog-mysql.x86_64 5.8.10-12.el6 base
rsyslog7-mysql.x86_64 7.4.10-7.el6 base
b、選擇安裝mysql安裝包
安裝mysql的客戶端:mysql.x86_64
[root@hadoop1 ~]# yum install mysql.x86_64 -y
安裝mysql服務端:mysql-server.x86_64
[root@hadoop1 ~]# yum install mysql-server.x86_64 -y
安裝mysql的依賴:mysql-devel.x86_64
[root@hadoop1 ~]# yum install mysql-devel.x86_64 -y
c、啓動mysqld服務
[root@hadoop1 ~]# service mysqld start —啓動mysql服務
/usr/bin/mysqladmin -u root password ‘new-password’
/usr/bin/mysqladmin -u root -h hadoop1 password ‘new-password’
[root@hadoop1 ~]# service mysqld stop —關閉mysql服務
mysql簡單配置—執行引擎,默認編碼格式
[root@hadoop1 ~]# vi /etc/my.cnf
default-storage-engine=InnoDB
default-character-set=utf8
重啓mysql服務
[root@hadoop1 ~]# service mysqld start
[root@hadoop1 ~]# mysqladmin -u root password ‘123456’
[root@hadoop1 ~]# mysqladmin -u root -h hadoop1 password ‘123456’
[root@hadoop1 ~]# mysql -uroot -p123456
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
hive的搭建:
hive數據倉庫-----主要利用HDFS做存儲,利用MapReduce做計算。
hive主要解決不會寫代碼會sql語句人羣也想要是用MapReduce。
hive運行的本質:把HQL語句轉化爲MapReduce
https://hive.apache.org/ ------hive官網
hive的安裝包-----apache-hive-2.1.1-bin.tar.gz
1、解壓apache-hive-2.1.1-bin.tar.gz安裝包
[root@hadoop1 ~]# tar -zxvf /tmp/apache-hive-2.1.1-bin.tar.gz -C /bigdata
2、配置hive的環境變量
[root@hadoop1 ~]# vi /etc/profile
#hive
export HIVE_HOME=/bigdata/apache-hive-2.1.1-bin
export PATH=HADOOP_HOME/bin:HIVE_HOME/bin:HOME/bin
3、修改hive配置
[root@hadoop1 ~]# cp /bigdata/apache-hive-2.1.1-bin/conf/hive-env.sh.template /bigdata/apache-hive-2.1.1-bin/conf/hive-env.sh
[root@hadoop1 ~]# vi /bigdata/apache-hive-2.1.1-bin/conf/hive-site.xml
修改hive-env.sh文件:
HADOOP_HOME=/bigdata/hadoop-2.7.3
export HIVE_CONF_DIR=/bigdata/apache-hive-2.1.1-bin/conf
修改hive-site.xml