centos7安装mysql
地址:http://repo.mysql.com/
下载
wget http://repo.mysql.com/mysql84-community-release-el7.rpm
解压rpm包内容
rpm -ivh mysql84-community-release-el7.rpm
查看是否解压成功
ls /etc/yum.repos.d/ -l
开始安装
yum install -y mysql-community-server
重启
systemctl restart mysqld
查看root账户的密码
grep ‘temporary password’ /var/log/mysqld.log
更改密码
mysql -uroot -p你的密码
登录
ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘更改的密码’; (注意你的密码要满足要求)
update mysql.user set host = ‘%’ where user =‘root’; (设置远程连接时使用)
刷新权限
flush privileges;
重启
systemctl restart mysqld
配置文件地址
/etc/my.cnf