当前位置:Gxlcms > 数据库问题 > CentOS7 安装 MySQL 5.7(yum) - IT书 - itbook.com

CentOS7 安装 MySQL 5.7(yum) - IT书 - itbook.com

时间:2021-07-01 10:21:17 帮助过:24人阅读

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

标签:安装 mysql   img   mysqld   utf8   mysq   ble   sql   png   利用   

人气教程排行