Linux下yum安装mysql-5.7,修改密码设置外网访问不区分大小写。

本文详细介绍了在Linux系统中如何使用yum安装MySQL 5.7,并涵盖了关闭防火墙、禁用SELinux以及优化服务器连接参数的步骤。此外,还涉及到配置MySQL以实现密码设置和外网访问,以及查看和修改数据库密码的操作。

关闭防火墙,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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值