hive选择mariadb还是mysql_Hive MariaDb的安装
1.安裝命令
yum -y install mariadb-server mariadb
2.進入mariadb數據庫
mysql -u root -p //第一次登錄時的密碼為空
3.修改mariadb數據庫密碼
update user set password=password('sugar') where user='root';
4.設置root用戶可以從任何主機登錄,對任何的庫和表都有訪問權限
grant all privileges on *.* to root@'%' identified by 'sugar';
grant all privileges on *.* to root@'sugar01' identified by 'sugar';
grant all privileges on *.* to root@'localhost' identified by 'sugar';
flush privileges;
5.修改mariadb的數據庫地址,真實集群節點中必要設置
1.停止服務
systemctl stop mariadb.service
2.復制原來的配置到系統盤外的磁盤(舉例是/data01)
cp /var/lib/mysql/ /data01/
3.備份原來的設置
mv /var/lib/mysql /var/lib/mysql.bak
4.修改磁盤中文件夾的所屬權限
chown -R mysql:mysql /data01/mysql
5.創建軟連接
ln -s /data01/mysql/ /var/lib/mysql
6.重啟mariadb
systemctl start mariadb
6.設置字符編碼為UTF-8(若需要的話)
1.查看默認編碼
show variables like 'character%';
show variables like 'collation_%';
2.修改編碼
1.備份配置文件
cp /etc/my.cnf /etc/my.cnf.bak
2.修改配置文件
vi /etc/my.cnf
插入內容 charater_set_server = utf8
3.重啟數據庫
systemctl restart mariadb
4.重新登錄,查看字符編碼
show variables like 'character%';
show variables like 'collation_%';
7.所有節點安裝mysql-connector-java驅動
yum -y install mysql-connector-java
安裝之后的路徑為/usr/share/java/mysql-connector-java.jar
8.安裝其他的依賴包
yum -y install psmisc
yum -y install perl
yum -y install nfs-utils portmap
systemctl start rpcbind
system enable rpcbind
9.創建數據庫和用戶
后續需要用到數據庫的組件,也在這里一并創建。這里創建hive、amon、hue、monitor和oozie
登錄數據庫,執行以下語句
注意包括主機名修改為自己的主機名
create database hive default charset utf8 collate utf8_general_ci;
create user 'hive'@'sugar01' identified by 'hive';
grant all privileges on hive.* to 'hive'@'sugar01';
flush privileges;
總結
以上是生活随笔為你收集整理的hive选择mariadb还是mysql_Hive MariaDb的安装的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: lgbt是什么意思啊(网络用语LGBT指
- 下一篇: mysql ssd tps 上不去_转【