centos下面安装mysql

本文提供了一个详细的指南,指导用户如何在CentOS5.5环境中,从MySQL5.1升级到MySQL5.5。包括设置yum仓库、卸载旧版本、安装新版本等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

MySQL 5.5 and 5.1 on CentOS 5.5

In a couple of days, MySQL 5.1 will move to extended lifecycle support, where only security fixes and the most severe bugs are fixed. MySQL 5.0 has bee like this for a year already. Typically, extended lifecycle will last for two years, after which will become end-of-line, where no support is guaranteed.

CentOS 5.x has been providing MySQL 5.0 in it’s distribution since that was the active stable branch when CentOS 5.0 was released on 12th April 2007 (or more specifically it’s upstream distribution RHEL 5, which was released 14th March 2007). Since then, Sun/Oracle have released MySQL 5.1 and MySQL 5.5, so the Webtatic Yum repository has added them to it’s web stack, which now provides updated versions of all the AMP in LAMP.
This release is different from the previous packages, since it is important to only upgrade MySQL when you are ready, and you may want to chose to follow only 5.1 updates or 5.5 updates. This does mean though that you will have to uninstall your current mysql installation first.

First, to set up the yum repository, install the webtatic-release RPM:

rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm

MySQL client library is used with several CentOS packages, so to remove MySQL without them, I have a mysql client library which is independent of the client tools, which can be installed first to be used instead.

yum install libmysqlclient15 --enablerepo=webtatic

Then you can uninstall MySQL:

yum remove mysql mysql-*

Then install the new MySQL version (either mysql51 or mysql55 can be installed here):

yum install mysql55 mysql55-server --enablerepo=webtatic

You should upgrade existing tables before setting the server to become a production machine, which can be done by starting the server and running the mysql_upgrade script (this may take time depending on the size of the database).

service mysqld start
mysql_upgrade

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

CentOS 8 上安装 MySQL 的步骤相对简单,以下是详细的操作指南: ### 步骤一:更新系统包 首先需要确保系统的软件包是最新的。运行以下命令: ```bash sudo dnf update -y ``` ### 步骤二:添加 MySQL Yum 存储库 由于 CentOS 官方仓库中默认不再提供 MySQL(已替换为 MariaDB),我们需要手动下载并配置官方的 MySQL Yum Repository。 1. 使用 `dnf` 或直接通过浏览器访问 [MySQL 官网](https://dev.mysql.com/downloads/repo/yum/) 下载存储库文件。 ```bash sudo dnf install https://dev.mysql.com/get/mysql80-community-release-el8.noarch.rpm -y ``` 2. 启用所需的版本模块(例如 MySQL 8.0): ```bash sudo dnf module enable mysql:8.0 ``` ### 步骤三:安装 MySQL Server 现在可以开始正式安装 MySQL 数据库服务端了: ```bash sudo dnf install mysql-server -y ``` 这会自动拉取必要的依赖项,并完成安装过程。 ### 步骤四:启动和启用 MySQL 服务 执行下面两行指令分别用于启动 MySQL 并设置开机自启功能: ```bash sudo systemctl start mysqld sudo systemctl enable mysqld ``` ### 步骤五:获取临时密码 初次安装完成后,默认生成了一个随机初始用户(root)密码保存于日志文件内。可以通过读取该内容找到它: ```bash sudo grep 'temporary password' /var/log/mysqld.log ``` ### 步骤六:修改root账户密码及安全加固 接下来按照提示更改 root 用户登录凭证并且加强安全性选项(如删除匿名账号、限制远程连接等),可通过内置脚本工具快速操作: ```bash sudo mysql_secure_installation ``` 以上便是完整的在 CentOS 8 系统上部署 MySQL 全部流程!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值