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 '********';

相关推荐
这个DBA有点耶4 分钟前
NULL不是空——数据库里最反直觉的设计,90%新人踩过的坑
数据库·mysql·代码规范
orion5720 小时前
Missing Semester Class1:course overview and introduction of shell
linux
用户120487221611 天前
Linux驱动编译与加载
linux·嵌入式
这个DBA有点耶1 天前
SQL改写进阶:标量子查询的“隐形代价”与消除实战
数据库·mysql·架构
smallyoung1 天前
数据库乐观锁深度解析:MySQL、PostgreSQL 实战 + Spring Boot 集成指南
数据库·mysql·postgresql
用户805533698031 天前
Input 子系统架构:Core、Handler、Driver 三层是怎么协作的
linux·嵌入式
用户805533698031 天前
RK-Forge外设系列开篇 - 把板子从「能启动」变成「能用」:Ethernet/SPI/MMC 三个纯接线外设
linux·github·嵌入式
数据技术说1 天前
MySQL 迁移实战——如何实现真正的"零改造"平滑切换
mysql
七歌杜金房2 天前
我终于又有了自己的 Linux 电脑
linux·debian·mac
tntxia3 天前
linux curl命令详解_curl详解
linux