CentOS 7中安装mysql server的步骤分享
作者:iVictor 时间:2024-01-20 13:33:56
以前一直用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~
标签:CentOS7,mysql
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
探讨Oracle中的&号问题
2024-01-22 09:13:31
XHTML1.0与HTML兼容指引16条[译]
2009-06-10 14:45:00
win2003 Server配置SQL Server 2005远程连接的方法
2024-01-17 10:09:06
![](https://img.aspxhome.com/file/2023/2/98052_0s.jpg)
在Python的Django框架中生成CSV文件的方法
2023-07-18 01:13:24
IE6/7关于 Absolute Position 、relative 的一些意外
2008-11-27 11:34:00
Django数据库连接丢失问题的解决方法
2024-01-18 12:05:24
Python输出指定字符串的方法
2023-07-29 15:06:02
vue实现下拉菜单树
2024-05-09 15:18:39
![](https://img.aspxhome.com/file/2023/7/126477_0s.jpg)
ASP获取ACCESS数据库的表名以及表名对应的字段名和字段类型
2009-12-25 18:57:00
pycharm配置git(图文教程)
2021-10-08 19:09:43
![](https://img.aspxhome.com/file/2023/3/92273_0s.png)
Python开发常用的一些开源Package分享
2022-12-10 22:00:11
python自制包并用pip免提交到pypi仅安装到本机【推荐】
2023-12-14 19:33:23
Golang并发编程之Channel详解
2024-05-09 14:58:42
解决pycharm安装第三方库失败的问题
2023-07-13 19:32:12
![](https://img.aspxhome.com/file/2023/8/120278_0s.jpg)
Python计时相关操作详解【time,datetime】
2023-08-24 17:12:56
numpy np.newaxis 的实用分享
2023-01-21 06:06:25
Python调用shell命令常用方法(4种)
2021-05-06 08:22:06
![](https://img.aspxhome.com/file/2023/8/76188_0s.png)
mysql如何查询日期与时间
2024-01-26 02:03:17
![](https://img.aspxhome.com/file/2023/8/112868_0s.png)
python使用rsa加密算法模块模拟新浪微博登录
2022-06-04 13:36:19
asp ajax注册验证之 防止用户名输入空格
2011-03-11 11:17:00