5.7 rpm安装调试版本

#下载页面
#8.0
https://dev.mysql.com/downloads/mysql/
#5.7
https://dev.mysql.com/downloads/mysql/5.7.html
阿里云安装说明:
https://blog.csdn.net/li1325169021/article/details/121515102

#安装插件
yum install -y wget 
wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-server-5.7.39-1.el7.x86_64.rpm
wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.39-1.el7.x86_64.rpm-bundle.tar

安装依赖
yum install -y libaio perl net-tools numactl autoconf perl-JSON initscripts

解压
cd /opt
mkdir /opt/mysql
tar -xvf /opt/mysql-5.7.39-1.el7.x86_64.rpm-bundle.tar -C /opt/mysql

安装
rpm -ivh /opt/mysql/*.rpm


初始化mysql
mysqld --initialize --user=root
后台启动
nohup mysqld --user=root &

通过查看mysqld日志,可以查看到默认的root用户临时密码
grep password /var/log/mysqld.log
密码:d4h9g<Th2NLQ
注意,如果默认密码存在诸如)之类的特殊符号,需要使用\进行转义
#登录
mysql -uroot -pd4h9g\<Th2NLQ
修改root用户临时密码:
ALTER USER 'root'@'localhost' IDENTIFIED BY '新的密码';
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
flush privileges;



编译安装

https://note.youdao.com/ynoteshare/index.html?id=15902f8ea62df53d9802d255225783cd&type=note&_time=1659063116915