第四篇 hiv安装-【1】安装MySQL【yum方式】

检查节点中是否自带mysql:

rpm -qa | grep mysql
rpm -qa | grep mariadb

如果有安装,需要卸载系统自带:

rpm -e mysql【一般删除,如果提示以来的其他文件,则不能删除】
rpm -e --nodeps mysql【强制删除,包含各种依赖包】
yum -y remove mysql* 【删除软件的时候会删除对该软件具有依赖关系的包】
【Tips:三种方式任选】

下载 mysql57-community-release-el7-9.noarch.rpm 的yum源:

wget http://mirrors.ustc.edu.cn/mysql-repo/mysql57-community-release-el7-9.noarch.rpm

安装rpm文件:

rpm -ivh mysql57-community-release-el7-9.noarch.rpm

yum安装mysql-community-server

yum -y install mysql-community-server

关闭强密码验证:

vim /etc/my.cnf
# 增加如下内容
plugin-load=validate_password.so
validate-password=OFF

启动mysql服务:

service mysqld start

获取随机密码:

[root@master ~]# grep "password" /var/log/mysqld.log
[Note] A temporary password is generated for root@localhost: r+RWXg*a7e%1

更改密码,进入mysql;

mysql -u root -p
mysql> SET PASSWORD = PASSWORD(‘123456‘);
mysql> ALTER USER ‘root‘@‘localhost‘ PASSWORD EXPIRE NEVER;
mysql> flush privileges;

查询用户表:

mysql> use  mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select  User,authentication_string,Host from user;
+---------------+-------------------------------------------+-----------+
| User          | authentication_string                     | Host      |
+---------------+-------------------------------------------+-----------+
| root          | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 | localhost |
| mysql.session | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | localhost |
| mysql.sys     | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | localhost |
+---------------+-------------------------------------------+-----------+
3 rows in set (0.00 sec)

设置任意IP访问:

mysql> grant all privileges on *.* to root@"%" identified by "123456";
mysql> flush privileges;

退出mysql:exit 设置开机启动mysql服务:systemctl enable mysqld

7.安装mysql连接工具

wget https://cdn.mysql.com/archives/mysql-connector-java-5.1/mysql-connector-java-5.1.45.tar.gz
tar -zxvf mysql-connector-java-5.1.45.tar.gz
cd mysql-connector-java-5.1.45
cp mysql-connector-java-5.1.45-bin.jar $HIVE_HOME/lib/

Hiv详细安装步骤中 Mysql

https://mp.weixin.qq.com/s?__biz=MjM5MDI4NTYxNA==&mid=100000751&idx=1&sn=da0addd5056dec1f7666016ca75e9257&chksm=264669ae1131e0b8caa08b6e13b23a8a3abbf81d6096124c9d38c62b08c7a1bf48a933314e8c&mpshare=1&scene=1&srcid=0708N4wEwi9Dd9cyEtI8sOjW&sharer_sharetime=1625737521885&sharer_shareid=94b30d7113700cb1835e85d5db498d62&key=4c9dc026f50000dcdc5c45d657005ec5bee9023b6ab558257a31fa51e5d9427d5d2d40d6717314b881563c6809dc56a925443429e5f143a667e4e425867ab6124336de4373204a4d4770b9ba76dea7f1a1ee34ee7e0dae8e1a9a71f101ed4372e0b52417e7f846d6ad592c483c691209a1bb1be79e61289175d73b385d4c43b1&ascene=1&uin=Njg0NTUwMTQz&devicetype=Windows+10+x64&version=62090538&lang=zh_CN&exportkey=AbUSig3pKw8cDwYcF0qtm2U%3D&pass_ticket=xBvUaT9RXCGGbJhcxu8gAObf2kXSvTd71hsDpzXKv7IJswm%2B%2FJmRGPOt28sNUP52&wx_header=0

第四篇 hiv安装-【1】安装MySQL【yum方式】

上一篇:分布式数据库(DorisDB、Clickhouse、TiDB)调研


下一篇:sqlservice 存储过程 查询判断多表数据,存在则返回