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

相关推荐
YH_DevJourney40 分钟前
Linux-C/C++《C/8、系统信息与系统资源》
linux·c语言·c++
威哥爱编程1 小时前
Linux驱动开发13个实用案例
linux
m0_748232641 小时前
mysql的主从配置
android·mysql·adb
去看日出1 小时前
Linux(centos)系统安装部署MySQL8.0数据库(GLIBC版本)
linux·数据库·centos
qq_448941081 小时前
10、k8s对外服务之ingress
linux·容器·kubernetes
D-river2 小时前
【如何基于Debian构建Kali Linux】
linux·网络·安全·网络安全
年轮不改3 小时前
ARM-Linux 基础项目篇——简单的视频监控
linux·arm开发
tian-ming3 小时前
MySQL(1)基础篇
数据库·mysql
隔壁老王1563 小时前
postgresql实时同步数据表mysql
数据库·mysql·postgresql
程序员JerrySUN4 小时前
树莓派 4B:AI 物联网完整部署方案
linux·人工智能·嵌入式硬件·物联网·分类·数据挖掘