Mysql在Linux上安装

先挂载镜像

mount /dev/sr0 /mnt

cd  /etc/yum.repos.d 配置yum源

vim yum.repo

配置仓库

[BaseOS]
name=baseos
baseurl=/mnt/BaseOS
enabled=1
gpgcheck=0
[AppStream]
name=app
baseurl=/mnt/AppStream
enabled=1
gpgcheck=0

 清空yum缓存

yum clean all

创建yum缓存仓库

yum makecache

查看列表

yum repolist

下载地址

Mysql官网====>DOWNLOADS====>MySQL Community (GPL) Downloads ====>Download Archives下载档案====>MySQL Community Server   MySql社区服务器====>MySQL Downloads

wget https://cdn.mysql.com/archives/mysql-8.0/mysql-8.0.34-1.el9.x86_64.rpm-bundle.tar




tar xvf mysql-8.0.34-1.el9.x86_64.rpm-bundle.tar

*********

dnf localinstall mysql-community-server-8.0.34-1.el9.x86_64.rpm 
mysql-community-client-8.0.34-1.el9.x86_64.rpm 
mysql-community-common-8.0.34-1.el9.x86_64.rpm 
mysql-community-icu-data-files-8.0.34-1.el9.x86_64.rpm 
mysql-community-client-plugins-8.0.34-1.el9.x86_64.rpm 
mysql-community-libs-8.0.34-1.el9.x86_64.rpm

启动服务  

systemctl start mysqld

第一次进入查看密码

grep password /var/log/mysqld.log

修改密码

ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码';     (字母+数字+特殊符号)

用远程管理工具链接Mysql数据库 

systemctl stop firewalld.service

进入mysql 

use mysql;
执行修改命令
update user set host='%' where user='root'; #前面的user是表后面得user是用户名
刷新权限管理
flush privileges;

你可能感兴趣的:(linux,mysql,centos)