centos7.3安装mysql5.1
时间: 2023-10-20 21:05:56 浏览: 158
1. 下载MySQL5.1的安装包,可以从MySQL官网下载,也可以使用yum安装:
```
yum install mysql-server
```
2. 安装MySQL,运行以下命令:
```
rpm -ivh MySQL-server-5.1.73-1.glibc23.x86_64.rpm
rpm -ivh MySQL-client-5.1.73-1.glibc23.x86_64.rpm
```
3. 配置MySQL,运行以下命令:
```
chkconfig --levels 235 mysqld on
service mysqld start
```
4. 设置MySQL的root用户密码,运行以下命令:
```
mysql_secure_installation
```
5. 登录MySQL,运行以下命令:
```
mysql -u root -p
```
6. 创建新用户,并授权:
```
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
FLUSH PRIVILEGES;
```
7. 退出MySQL:
```
exit
```
以上是CentOS 7.3安装MySQL5.1的简单步骤,具体操作可以根据实际情况进行调整。
阅读全文