CentOS部署MySQL

1.配置yum仓库

#更新秘钥 rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2023

#安装MySQL rpm -Uvh http://dev.mysql.com/get/mysql80-community-release-el7-2.noarch.rpm

2.使用yum安装MySQL

yum -y install mysql-community-server

3.启动MySQL并配置开机自启动

systemctl start mysqld #启动

systemctl enable mysqld #开机自启

systemctl status mysqld #检查状态

3.配置root用户

获取root初始密码 grep "temporary password" /var/log/mysqld.log

登录mysql

mysql -uroot -p

修改root用户密码

alter user 'root'@'localhost' identified with mysql_native_password by '********';

配置远程连接并退出登录

create user 'root'@'%' identified with mysql_native_password by '********';

相关推荐
xuzhiqiang07241 小时前
MySQL——数据库的操作
数据库·mysql·oracle
i建模1 小时前
Omarchy设置防火墙
linux·运维
S-码农2 小时前
Linux ——条件变量
linux·开发语言
爱写代码的liding2 小时前
linux安装软件过程中报找不到某些动态链接.so文件
linux
青衫码上行2 小时前
【项目部署】Spring Boot项目部署的四种方式
java·linux·服务器·spring boot·后端·docker·腾讯云
礼拜天没时间.3 小时前
JumpServer堡垒机部署与实战:从0到1搭建统一运维入口
linux·运维·架构·堡垒机·jumpserver·sre
林姜泽樾4 小时前
linux入门第四章,cd指令和相对、绝对路径
linux·运维·服务器
jjjxxxhhh1234 小时前
[Google Test]- Google Test Ubuntu 完整验证指南
linux·数据库·ubuntu
江畔何人初4 小时前
kubernetes中configmap与secret的区别
linux·运维·云原生·容器·kubernetes
夏乌_Wx4 小时前
mybash:简易 Shell 实现的设计思路与核心模块解析
linux·服务器·前端