Linux安装MySQL数据库
Posted 岱宗夫如何、
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux安装MySQL数据库相关的知识,希望对你有一定的参考价值。
背景:用mysql存储hive的元数据
从官网下载
MySQL :: MySQL Community Downloads
mysql-5.7.28-1.el7.x86_64.rpm-bundle.tar
mysql-connector-java-5.1.37.jar
解压安装包
mkdir mysql_lib
tar -xf mysql-5.7.28-1.el7.x86_64.rpm-bundle.tar -C mysql_lib/
安装依赖
cd mysql_lib
sudo yum localinstall mysql-community-common-5.7.28-1.el7.x86_64.rpm mysql-community-libs-5.7.28-1.el7.x86_64.rpm mysql-community-libs-compat-5.7.28-1.el7.x86_64.rpm
安装mysql-client
sudo yum localinstall mysql-community-client-5.7.28-1.el7.x86_64.rpm
安装mysql-server
sudo yum localinstall mysql-community-server-5.7.28-1.el7.x86_64.rpm
配置mysql的远程登录
1. 启动mysql
sudo systemctl start mysqld
sudo systemctl status mysqld
2. 查看mysql初始化的密码
sudo cat /var/log/mysqld.log | grep password
3. 配置
mysql -uroot -p'password'
降低mysql密码的安全等级
set global validate_password_policy=0;
降低安全等级为0级的密码限制长度
set global validate_password_length=4;
set password=password("123456");
use mysql;
select user, host from user;
update user set host="%" where user="root";
flush privileges;
quit;
以上是关于Linux安装MySQL数据库的主要内容,如果未能解决你的问题,请参考以下文章