当前位置: 首页 > article >正文

【Linux】统信UOS服务器安装MySQL8.0(RPM)

目录

一、下载安装包

二、安装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&amp;allowPublicKeyRetrieval=true&amp;characterEncoding=UTF-8&amp;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博客


http://www.kler.cn/a/502262.html

相关文章:

  • Mysql--架构篇--体系结构(连接层,SQL层,存储引擎层,文件存储层)
  • 学习threejs,使用TrackballControls相机控制器
  • jenkins的作用以及操作
  • Java Web开发基础:HTML的深度解析与应用
  • elasticsearch中IK分词器
  • Python实现windows自动关机
  • 【PPTist】插入形状、插入图片、插入图表
  • Nginx安全加固系列:404页面失去保护
  • 使用vue3、vite打包项目中组件库中的某一个组件,并将其推送至npm上
  • 【2】WLC的接口有哪些?
  • C# OpenCV机器视觉:转速测量
  • uni-app与uni-app x:跨端开发更上一层楼
  • 【Apache Paimon】-- Paimon Filesysterm Catalog 和 Hive Catalog 的适用场景
  • 深度优先和广度优先【栈、堆前端举例】
  • 1. npm 常用命令详解
  • 国产Docker可视化面板Dpanel的安装与功能解析
  • ASP.NET Core的部署、维护、日志记录和错误处理
  • 工业5G路由器 赋能车联网,让大巴车 “智” 行无忧
  • 25年无人机行业资讯 | 1.1 - 1.5
  • 【数据结构-堆】【哈希+最小堆】力扣1942. 最小未被占据椅子的编号
  • OpenAI O3模型:重构软件测试的未来
  • RK3568 Android 13 内置搜狗输入法小计
  • 【Excel】【VBA】根据某列的编号顺序筛选对应的行导入相应的sheet中
  • 网络学习记录2
  • TorchOptimizer:基于贝叶斯优化的PyTorch Lightning超参数调优框架
  • Java 模板变量替换——字符串替换器(思路Mybatis的GenericTokenParser)