Centos7部署单点mysql
一、部署mysql
1.1、下载rpm包
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
1.2、安装
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
1.3、启动数据库,修改初始秘密
systemctl start mysqld
#找到默认密码
grep "password" /var/log/mysqld.log
#进入数据库
mysql -uroot -p
#修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'h0uBPTVtmzF>1xuW';
二、创建远程用户,授权
CREATE USER 'root'@'%' IDENTIFIED BY 'h0uBPTVtmzF>1xuW';
grant all privileges on *.* to 'root'@'%';