centos7一键安装mysql

首先在源里面增加

 

源地址 https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/

centos7一键安装mysql_第1张图片

然后使用添加进去

vim CentOS-Base.repo

#Enable to use MySQL 5.7
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

yum install mysql-community-server

一键安装

 

安装完mysql 已经有默认密码  就要去查看mysql的日志啦

vim /var/log/mysqld.log   

 

然后设置密码

 

set global validate_password_policy=0;

 

 

 

ALTER USER USER() IDENTIFIED BY '12345678';  设置密码

你可能感兴趣的:(mysql)