安装mysql5.0.96在centos7.3中
时间: 2024-05-06 15:19:50 浏览: 125
以下是在CentOS 7.3中安装MySQL 5.0.96的步骤:
1. 确认系统已经安装了wget和tar:
```
sudo yum install wget tar
```
2. 下载MySQL 5.0.96:
```
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.0.96.tar.gz
```
3. 解压缩:
```
tar -xvf mysql-5.0.96.tar.gz
```
4. 安装依赖项:
```
sudo yum install gcc-c++ ncurses-devel
```
5. 进入MySQL源码目录,运行configure:
```
cd mysql-5.0.96
./configure
```
6. 编译和安装:
```
make
sudo make install
```
7. 创建MySQL用户和组:
```
sudo groupadd mysql
sudo useradd -r -g mysql mysql
```
8. 初始化数据库:
```
sudo /usr/local/mysql/bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
```
9. 修改MySQL配置文件:
```
sudo cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
sudo vi /etc/my.cnf
```
在[mysqld]下面添加以下内容:
```
datadir=/usr/local/mysql/data
socket=/var/lib/mysql/mysql.sock
```
10. 启动MySQL服务:
```
sudo /usr/local/mysql/bin/mysqld_safe --user=mysql &
```
11. 登录MySQL:
```
sudo /usr/local/mysql/bin/mysql -uroot
```
现在,您已经成功地在CentOS 7.3中安装了MySQL 5.0.96。
阅读全文