目錄
一、下載安裝包
二、安裝MySQL
2.1hive適配
2.2ranger適配
3.2DolphinScheduler適配
一、下載安裝包
官網下載安裝包:MySQL :: MySQL Downloads
選擇社區版本下載
點擊MySQL Community Server
選擇對應系統的MySQL版本號
統信1060a 操作系統對應 redhat8 ,我們下載對應MySQL RPM包
選擇直接下載
二、安裝MySQL
## 解壓
tar -xvf mysql-8.0.40-1.el8.x86_64.rpm-bundle.tar## 安裝
yum install -y net-tools perl libaio
rpm -ivh mysql-community-common-8.0.40-1.el8.x86_64.rpm
rpm -ivh mysql-community-client-plugins-8.0.40-1.el8.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.40-1.el8.x86_64.rpm
rpm -ivh mysql-community-client-8.0.40-1.el8.x86_64.rpm
rpm -ivh mysql-community-icu-data-files-8.0.40-1.el8.x86_64.rpm
rpm -ivh mysql-community-server-8.0.40-1.el8.x86_64.rpm
啟動MySQL
systemctl start mysqld 這個是啟動mysql
systemctl status mysqld 查看mysql的狀態# 查看默認密碼
grep password /var/log/mysqld.log
查看密碼
grep password /var/log/mysqld.log
-- 進入mysql
mysql -uroot -p 敲回車
粘貼密碼即可修改默認密碼
alter user root@localhost identified by 'G1u2n3h4e5!';
4、更改密碼策略等級
set global validate_password.policy=LOW; # 修改密碼策略等級為LOW
set global validate_password.length=4; # 密碼的最小長度
set global validate_password.mixed_case_count=0; # 設置密碼中至少要包含0個大寫字母和小寫字母
set global validate_password.number_count=0; # 設置密碼中至少要包含0個數字
set global validate_password.special_char_count=0; # 設置密碼中至少要包含0個特殊字符5、 修改更簡單的密碼
alter user root@localhost identified by 'Winner@123456';
修改密碼
創建用戶和數據庫
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;-- datasophon元數據庫
CREATE DATABASE IF NOT EXISTS datasophon DEFAULT CHARACTER SET utf8;
create user datasophon@'%' identified by 'datasophon';
grant all privileges on *.* to datasophon@'%' with grant option;
FLUSH PRIVILEGES;-- hive元數據庫
CREATE DATABASE IF NOT EXISTS hive DEFAULT CHARACTER SET utf8;
create user hive@'%' identified by 'hive';
grant all privileges on *.* to hive@'%' with grant option;
FLUSH PRIVILEGES;-- ranger元數據庫
CREATE DATABASE IF NOT EXISTS ranger DEFAULT CHARACTER SET utf8;
create user ranger@'%' identified by 'Winner@123456';
grant all privileges on *.* to ranger@'%' with grant option;
FLUSH PRIVILEGES;-- dolphinscheduler元數據庫
CREATE DATABASE IF NOT EXISTS dolphinscheduler DEFAULT CHARACTER SET utf8;
create user dolphinscheduler@'%' identified by 'dolphinscheduler';
grant all privileges on *.* to dolphinscheduler@'%' with grant option;
FLUSH PRIVILEGES;
use dolphinscheduler;
source /opt/datasophon/DDP/packages/dolphinscheduler_mysql.sql;
2.1hive適配
-- 數據庫鏈接地址<property><name>javax.jdo.option.ConnectionURL</name><value>jdbc:mysql://ddp01:3306/hive?useUnicode=true&allowPublicKeyRetrieval=true&characterEncoding=UTF-8&useSSL=false</value></property>-- 初始化數據庫
cd bin
./schematool -dbType mysql -initSchema
適配hive需要增加jar包,修改jdbc 連接URL。
2.2ranger適配
初始化SQL文件中添加如下參數:
set global log_bin_trust_function_creators=TRUE;
/home/datasophon/ranger-2.1.0/db/mysql/optimized/current/ranger_core_db_mysql.sql
可能報錯如下,加上面的參數可避免
2025-01-08 15:38:17,746 [JISQL] /usr/java/jdk1.8.0_162/bin/java -cp /opt/datasophon/ranger-2.1.0/mysql-connector-java-8.0.28.jar:/home/datasophon/ranger-2.1.0/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://127.0.0.1/ranger -u 'ranger' -p '********' -noheader -trim -c \; -input /home/datasophon/ranger-2.1.0/db/mysql/optimized/current/ranger_core_db_mysql.sql
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
Error executing: CREATE FUNCTION `getXportalUIdByLoginId`(input_val VARCHAR(100)) RETURNS int(11) BEGIN DECLARE myid INT; SELECT x_portal_user.id into myid FROM x_portal_user WHERE x_portal_user.login_id = input_val; RETURN myid; END
java.sql.SQLException: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
SQLException : SQL state: HY000 java.sql.SQLException: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) ErrorCode: 1418
2025-01-08 15:38:39,290 [E] ranger_core_db_mysql.sql file import failed!
3.2DolphinScheduler適配
DolphinScheduler數據庫地址:
jdbc:mysql://ddp01:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true
hive的安裝和配置:
Hive3.1.2與MySQL8.0集成配置教程-CSDN博客
ranger 2.3.0 從源碼編譯到搭配 MySQL 8.0 的踩坑:
ranger 2.3.0 從源碼編譯到搭配 MySQL 8.0 的踩坑-騰訊云開發者社區-騰訊云
Hadoop_HA搭建:
Hadoop_HA搭建_hadoop ha-CSDN博客
ubuntu下Hive3.1.3與MySQL8的配置與安裝:
ubuntu下Hive3.1.3與MySQL8的配置與安裝_hive3 mysql8-CSDN博客