CentOS7安装与设置MySQL
发表时间:2023-07-27 来源:明辉站整理相关软件相关文章人气:
[摘要]1. 下载MySQL Yum Repository2. 本地安装MySQL Yum Repository
sudo yum localinstall platform-and-version-spe...
?
1. 下载MySQL Yum Repository
?
2. 本地安装MySQL Yum Repository
sudo yum localinstall platform-and-version-specific-package-name.rpm
?
3. 安装MySQL
sudo yum -y install mysql-community-server
?
4. 查看root初始密码
sudo grep 'temporary password' /var/log/mysqld.log
?
5. 执行安全性设置
mysql_secure_installation
?
6.设置字符集
vi /etc/my.cnf
[mysql]
default-character-set=utf8
[mysqld]
character_set_server=utf8
?
7. 设置开机启动
chkconfig --levels 235 mysqld on
?
8. 关闭CentOS防火墙
firewall-cmd --permanent --zone=public --add-port=3306/tcp
firewall-cmd --permanent --zone=public --add-port=3306/udp
firewall-cmd --reload
?
9. 创建远程访问用户
CREATE USER 'bounter'@'%' IDENTIFIED BY '111111@Bounter';
GRANT SELECT,INSERT,UPDATE,DELETE ON *.* TO 'bounter'@'%';
flush privileges;
?
10. 启动和关闭MySQL服务
sudo service mysqld start
sudo service mysqld stop
以上就是CentOS7安装和配置MySQL的详细内容,更多请关注php中文网其它相关文章!
学习教程快速掌握从入门到精通的SQL知识。