linux在线安装mysql
1)下载rpm安装包
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm;
2) 安装mysql源
yum localinstall mysql57-community-release-el7-8.noarch.rpm
3)检查mysql源是否安装成功
yum repolist enabled | grep "mysql.*-community.*"
4)开始安装mysql
yum install mysql-community-server
yum install mysql-community-devel
5)启动mysql
service mysqld start
6)查看mysql启动状态
service mysqld status
7)设置开机启动
systemctl enable mysqld
systemctl daemon-reload
8)获取mysql默认生成的密码
grep 'temporary password' /var/log/mysqld.log
9)更换密码
set global validate_password_policy=0;
set global validate_password_length=1;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';