MySQL 8.0 通过rpm包安装
mysql-8.0安装
#前往官网下载https://dev.mysql.com/downloads/mysql/
#按照顺序安装MySQL依赖
rpm -ivh mysql-community-common-8.0.31-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-plugins-8.0.31-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.31-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-8.0.31-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.31-1.el7.x86_64.rpm
rpm -ivh mysql-community-icu-data-files-8.0.31-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.31-1.el7.x86_64.rpm
#初始化MySQL
mysqld --initialize --user=mysql
#开启MySQL服务
systemctl start mysqld
#查看MySQL的临时密码
cat /var/log/mysqld.log
#//PhPwCzkpE9-l
#进入MySQL
mysql -uroot -p
#修改初始密码
use mysql;
alter user 'root'@'localhost' identified by '123456';
#开启远程登录
update user set host='%' where user='root' and host='localhost';
#退出MySQL
exit;
#重启MySQL服务
systemctl restart mysqld
学习要有计划、代码要经常练习、学习之后要有输出、多交流、多总结、找出规律。
忌三天打鱼两天晒网、浅尝辄止、闭门造车