ubuntun20.04 mysql5.7
时间: 2023-09-23 22:06:46 浏览: 79
mysql5.7.20linux安装版本
To install MySQL 5.7 on Ubuntu 20.04, follow these steps:
1. Update the package list and upgrade the system:
```
sudo apt update
sudo apt upgrade
```
2. Install the MySQL server package:
```
sudo apt install mysql-server
```
3. During the installation process, you will be prompted to create a root password for MySQL. Set a strong password and remember it.
4. After the installation is complete, start the MySQL service and enable it to start automatically on system boot:
```
sudo systemctl start mysql
sudo systemctl enable mysql
```
5. To check if the MySQL service is running, you can use the following command:
```
sudo systemctl status mysql
```
6. To secure your MySQL installation, you can run the script that comes with the package:
```
sudo mysql_secure_installation
```
7. Follow the prompts to set a password policy, remove anonymous users, disallow root login remotely, and remove test databases.
8. You can now access the MySQL server using the root account and the password that you set during installation.
Note: If you specifically need MySQL 5.7 instead of the latest version, you can use the following command to install it:
```
sudo apt install mysql-server-5.7
```
阅读全文