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

相关推荐
..Dauntless..1 天前
【Linux】一切皆文件和缓冲区
linux·运维·服务器
QMCY_jason1 天前
x86 ubuntu2204 无gui 安装 openeuler 2203 aarch64版本
linux·运维·服务器
重生之小比特1 天前
【Linux系统】12 进程程序替换 自定义Shell 命令行解释器
linux·运维·服务器
あ-1 天前
CubeSandBox配置CubeMaster CPU 超分
linux·运维·服务器
小羊没烦恼!1 天前
Ajax与JSON的一些总结
android·java·前端·数据库·mysql·算法·okhttp
Escalating_xu1 天前
【Linux 网络编程】TCP Socket 编程(上):从 listen、accept 到完整回显通信
linux·网络·tcp/ip
老秦包你会1 天前
Linux第十课---------Linux信号
linux
geovindu1 天前
sql: JSON and XML Data Handling in SQL using mysql 9.0
数据库·sql·mysql·数据库开发
Mortalbreeze1 天前
MySQL 基础篇(九):从 B+ 树到索引优化,全面理解 MySQL 索引
数据库·mysql
猫咪很可爱1 天前
mysqldump 失败常见场景
数据库·sql·mysql