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

相关推荐
Joseph Cooper27 分钟前
STM32MP157 Linux驱动学习笔记(四):典型总线与设备模型(SPI/USB)
linux·stm32·学习
阿丰资源32 分钟前
基于SpringBoot+MySQL的社区团购系统设计与实现(附源码+文档+数据库,直接运行)
数据库·spring boot·mysql
坚持就完事了37 分钟前
Linux中的mv命令
linux·运维·服务器
SongYuLong的博客42 分钟前
Claude Code安装配置(Linux)
linux·运维·服务器
阿丰资源1 小时前
基于SpringBoot+MySQL的网上订餐系统(附源码)
spring boot·后端·mysql
代码不加糖1 小时前
0基础搭建前后端分离项目:实现菜单与界面左右布局
java·前端·javascript·mysql·elementui·mybatis
还是阿落呀1 小时前
第二章 数据类型、表的约束
数据库·mysql
WL_Aurora1 小时前
MySQL 插入中文报错 ERROR 1366 (HY000): Incorrect string value 的解决办法
数据库·mysql
栈低来信1 小时前
kernel信号量源码分析
linux
Bert.Cai2 小时前
MySQL UPPER()函数详解
数据库·mysql