CentOS7安装MySQL

编程

一、准备安装文件

先去官网下载安装包,注意系统要选择RedHat 7

然后解压得到下边这些文件

二、开始安装

#删除mariadb的文件,不然会冲突

[iceberg@localhost mysql5.5]# sudo yum -y remove mariadb-libs

[iceberg@localhost mysql5.5]# sudo rpm -ivh *.rpm

warning: MySQL-client-5.5.62-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

error: Failed dependencies:

perl(Data::Dumper) is needed by MySQL-server-5.5.62-1.el7.x86_64

perl(Data::Dumper) is needed by MySQL-test-5.5.62-1.el7.x86_64

方案:

安装 perl 和 自动配置 autoconf

# 安装 perl

[iceberg@localhost mysql5.5]# sudo yum install perl

# 安装 autoconf 解决 perl(Data::Dumper) 问题

[iceberg@localhost mysql5.5]# sudo yum -y install autoconf

Installed:

autoconf.noarch 0:2.69-11.el7

Dependency Installed:

perl-Data-Dumper.x86_64 0:2.145-3.el7

[iceberg@localhost mysql5.5]# sudo rpm -ivh *.rpm

安装完成后,会提示你记得修改root用户的密码

# 启动mysql server

[iceberg@localhost mysql5.5]# systemctl start mysql

# 修改密码,删除匿名用户

[iceberg@localhost mysql5.5]# /usr/bin/mysql_secure_installation

三、验证

mysql --version

以上是 CentOS7安装MySQL 的全部内容, 来源链接: utcz.com/z/512145.html

回到顶部