Mysql部署
- 环境介绍
- 关闭防火墙及SELINUX
systemctl stop firewaald
systemctl disable firewalld
setenforce 0
sed -i '/^SELINUX=/s/enforcing/disabled/' /etc/selinux/config
- 下载
官方下载地址
- 解压
tar -xvf mysql-8.0.24-1.el8.x86_64.rpm-bundle.tar
- 安装
yum -y install mysql-community-*.rpm
耐心等待安装完成
- [mysqld]内增加配置:lower_case_table_names=1
vi /etc/my.cnf
如图:
- 启动服务
systemctl start mysqld
- 获取初始密码
grep password /var/log/mysqld.log
- 登陆
mysql -u root -p'qyZc%ds%#0;;'
- 配置
alter user 'root'@'localhost' identified by '你的密码';
update mysql.user set host='%' where user='root';
alter user root@'%' identified with mysql_native_password by '你的密码';
flush privileges;
- 测试远程连接