关闭防火墙,selinux机制 ,优化服务器连接参数。
setenforce 0
getenforce
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
echo "* soft nofile 65535" >> /etc/security/limits.conf
echo "* hard nofile 65535" >> /etc/security/limits.conf
echo -e "net.core.netdev_max_backlog = 262144\nnet.core.somaxconn = 262144\nnet.ipv4.tcp_max_syn_backlog = 262144\nnet.ipv4.tcp_timestamps = 0\nnet.ipv4.tcp_synack_retries = 1\nnet.ipv4.tcp_syn_retries = 1" >> /etc/sysctl.conf
/sbin/sysctl -p
=========================================================
开始安装
yum -y install wget
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
修改配置文件,设置不分区大小写
vim /etc/my.cnf
在尾部追加一行
lower_case_table_names=1
保存退出即可
systemctl start mysqld.service
systemctl status mysqld.service
查看密码:
grep 'temporary password' /var/log/mysqld.log
=========================================================
登陆,修改密码
mysql -uroot -p
设置新密码:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Root_12root';
flush privileges;
use mysql;
设置root可以外网登陆
update user set host = "%" where user='root';
flush privileges;
quit
本文详细介绍了在Linux系统中如何使用yum安装MySQL 5.7,并涵盖了关闭防火墙、禁用SELinux以及优化服务器连接参数的步骤。此外,还涉及到配置MySQL以实现密码设置和外网访问,以及查看和修改数据库密码的操作。

643

被折叠的 条评论
为什么被折叠?



