Welcome To Heike07's Blog.

欢迎来到Heike07官方博客

MYSQL-Centos本地安装(RPM)

本次教程为mysql的RPM安装原创教程,如果有不对的地方欢迎指出!

欢迎关注heike07~

准备文件

tar -xvf mysql-5.7.31-1.el7.x86_64.rpm-bundle.tar(需要在mysql官方下载)

开始安装

删除原有包 mariadb rpm(演示的是系统预装情况,根据自己的情况进行处理)

rpm -qa|grep mariad

rpm -e –nodeps mariadb-libs-5.5.56-2.el7.x86_64

rpm -ivh mysql-community-common-5.7.31-1.el7.x86_64.rpm

rpm -ivh mysql-community-libs-5.7.31-1.el7.x86_64.rpm

rpm -ivh mysql-community-client-5.7.31-1.el7.x86_64.rpm

rpm -ivh mysql-community-server-5.7.31-1.el7.x86_64.rpm –force –nodeps

rpm -ivh mysql-community-devel-5.7.31-1.el7.x86_64.rpm

启动mysql

systemctl start mysqld

开机启动设置

systemctl enable mysqld

查看mysql状态 正常应该是active

systemctl status mysqld

初始化配置

查看临时密码

grep ‘temporary password’ /var/log/mysqld.log

初始密码进入

mysql -uroot -p

设置root本地账户密码

ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘your_password’

设置root远程账户密码以及权限

GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘your_password’ WITH GRANT OPTION

更新权限表

flush privileges

配置防火墙

firewall-cmd –permanent –add-port=3306/tcp

firewall-cmd –reload

用链接工具测试 作者:heike07 https://www.bilibili.com/read/cv11699513 出处:bilibili

《MYSQL-Centos本地安装(RPM)》

用链接工具测试

作者:heike07 https://www.bilibili.com/read/cv11699513 出处:bilibili

点赞