CentOS 7中安装mysql server的步骤分享
程序员文章站
2024-02-25 10:19:52
以前一直用rhel 6.3和6.4,系统盘里自带了mysql server,配置好yum源后,直接yum install mysql-server就可安装mysql服务器端...
以前一直用rhel 6.3和6.4,系统盘里自带了mysql server,配置好yum源后,直接yum install mysql-server就可安装mysql服务器端了,最近用centos 7.1,发现系统盘没有提供mysql-server的rpm包,在网上搜罗了半天,最后在mysql的官方网站找到答案。
只需在/etc/yum.repos.d/目录下添加以下文件mysql-community.repo文件,内容如下:
# enable to use mysql 5.6 [mysql56-community] name=mysql 5.6 community server baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/5/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-mysql
以上对应的是5.6版本。
5.7版本的内容如下:
# note: mysql 5.7 is currently in development. for use at your own risk. # please read with sub pages: https://dev.mysql.com/doc/relnotes/mysql/5.7/en/ [mysql57-community-dmr] name=mysql 5.7 community server development milestone release baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-mysql
最后执行yum install mysql-community-server即可。
我用的是5.6版本的内容,在安装的过程中,报以下错误:
gpg key retrieval failed: [errno 14] curl#37 - "couldn't open file /etc/pki/rpm-gpg/rpm-gpg-key-mysql"
很显然,本地没有rpm-gpg-key-mysql文件,于是对上文的mysql-community.repo做了一下修改,修改后的内容如下:
[mysql56-community] name=mysql 5.6 community server baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/5/$basearch/ enabled=1 gpgcheck=0
重新执行yum install mysql-community-server命令,安装ok~
推荐阅读
-
CentOS 7中安装mysql server的步骤分享
-
Centos7使用yum安装Mysql5.7.19的详细步骤
-
CentOS 7中安装mysql server的步骤分享_MySQL
-
CentOS安装配置MySQL8.0的步骤详解
-
linux 用yum命令安装mysql的步骤分享
-
CentOS 7.4 64位安装配置MySQL8.0的详细步骤
-
centos6利用yum安装php mysql gd的步骤
-
centos6.5 Linux下用安装包方式安装MySQL的步骤教程
-
CentOS 6.2编译安装Nginx1.0.14+MySQL5.5.22+PHP5.3.10步骤分享
-
CentOS7.6安装MYSQL8.0的步骤详解