CentOS7 安装 MySQL 5.7(yum) - IT书 - itbook.com
Posted itbook-com
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS7 安装 MySQL 5.7(yum) - IT书 - itbook.com相关的知识,希望对你有一定的参考价值。
原创来源:IT书 - itbook.com
安装并启动
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm yum localinstall mysql57-community-release-el7-8.noarch.rpm -y yum repolist enabled | grep "mysql.*-community.*" yum install mysql-community-server -y systemctl start mysqld systemctl status mysqld systemctl enable mysqld
获取 mysql 初始密码
grep ‘temporary password‘ /var/log/mysqld.log
进入 mysql
利用上一步获取的初始密码登录
mysql -uroot -p
设置 mysql 新密码
set global validate_password_policy=0; alter user ‘root‘@‘localhost‘ identified by ‘Aafsdfa24tg‘; update mysql.user set host = ‘%‘ where user = ‘root‘; flush privileges;
创建数据库hive
create database hive character set utf8 ; CREATE USER ‘hive‘@‘%‘IDENTIFIED BY ‘Aafsdfa24tg‘; GRANT ALL PRIVILEGES ON *.* TO ‘hive‘@‘%‘; FLUSH PRIVILEGES; exit;
安装 mysql java 驱动
yum install mysql-connector-java -y
登录
mysql -uroot -pAafsdfa24tg
以上是关于CentOS7 安装 MySQL 5.7(yum) - IT书 - itbook.com的主要内容,如果未能解决你的问题,请参考以下文章