CentOS部署MYSQL

2019-08-05  本文已影响0人  清霆

1. 卸载mariadb(如有)

rpm -qa | grep mariadb

rpm -e --nodeps mariadb*包名

2. 安装MYSQL

yum install -y https://repo.mysql.com/mysql80-community-release-el7.rpm

yum install mysql-community-server

systemctl start  mysqld.service

3. 配置MYSQL

grep"password" /var/log/mysqld.log  //查看初始密码

mysql -uroot -p密码

set globalvalidate_password.policy=0;

set globalvalidate_password.length=8;

ALTER USER'root'@'localhost' IDENTIFIED BY 'Mysql密码';

exit

mysqld --verbose--help | grep -A 1 "Default options"

vim /etc/my.cnf

default_password_lifetime=0

systemctl enable mysqld.service

systemctl restart mysqld.service

firewall-cmd--zone=public --add-port=3306/tcp --permanent

firewall-cmd--reload

上一篇下一篇

猜你喜欢

热点阅读