centos7 yum安装mysql

第一步:下载yum源

wget 'https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm'

  

第二步:安装yum源

rpm -ivh mysql57-community-release-el7-11.noarch.rpm

  

第三步:安装MySQL

yum install -y mysql-community-server

  

第四步(获取root密码):

grep "password" /var/log/mysqld.log

  

第五步(修改密码):

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';

  

第六步(开启远程访问):

grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;
flush privileges; 

  

 

posted @ 2021-09-15 14:48  映辉  阅读(39)  评论(0)    收藏  举报