linux centos 安装mysql8
时间: 2023-12-12 21:35:23 浏览: 124
以下是在Linux CentOS 7上安装MySQL 8的步骤:
1.添加MySQL Yum Repository
```shell
sudo rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
```
2.安装MySQL Server
```shell
sudo yum install mysql-server
```
3.启动MySQL服务
```shell
sudo systemctl start mysqld
```
4.检查MySQL服务状态
```shell
sudo systemctl status mysqld
```
5.设置MySQL开机自启
```shell
sudo systemctl enable mysqld
```
6.设置MySQL大小写不敏感
```shell
sudo vim /etc/my.cnf
```
在[mysqld]下添加以下内容:
```shell
lower_case_table_names=1
```
7.重启MySQL服务
```shell
sudo systemctl restart mysqld
```
8.登录MySQL
```shell
sudo mysql -u root -p
```
以上是在Linux CentOS 7上安装MySQL 8的步骤。
相关问题
linux中centos7.8安装mysql
在CentOS 7.8上安装MySQL的步骤如下:
1. 更新系统:
```
sudo yum update
```
2. 添加MySQL的Yum存储库:
```
sudo yum install epel-release
sudo rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
```
3. 安装MySQL服务器:
```
sudo yum install mysql-server
```
4. 启动MySQL服务:
```
sudo systemctl start mysqld
```
5. 运行MySQL安全性脚本,设置root密码和其他安全选项:
```
sudo mysql_secure_installation
```
6. 配置MySQL开机自启动:
```
sudo systemctl enable mysqld
```
现在,MySQL已经成功安装在CentOS 7.8上了。
阅读全文