介绍 (Introduction)
MySQL is an open-source database management system, commonly installed as part of the popular LAMP (Linux, Apache, MySQL, PHP/Python/Perl) stack. It implements the relational model and uses Structured Query Language (better known as SQL) to manage its data.
MySQL是一个开源数据库管理系统,通常作为流行的LAMP (Linux,Apache,MySQL,PHP / Python / Perl)堆栈的一部分安装。 它实现了关系模型,并使用结构化查询语言(又称SQL)来管理其数据。
This quickstart tutorial will explain how to install MySQL version 8.0 on an Ubuntu 20.04 server.
本快速入门教程将说明如何在Ubuntu 20.04服务器上安装MySQL 8.0版。
先决条件 (Prerequisites)
To follow this tutorial, you will need:
要遵循本教程,您将需要:
One Ubuntu 20.04 server with a non-root administrative user and a firewall configured with UFW. To set up, follow our initial server setup guide for Ubuntu 20.04.
一台Ubuntu 20.04服务器,具有非root用户和配置了UFW的防火墙。 要进行设置,请遵循我们针对Ubuntu 20.04的初始服务器设置指南 。
第1步-安装MySQL (Step 1 — Installing MySQL)
To install MySQL, first update your server’s package index if you’ve not done so recently:
要安装MySQL,请先更新服务器的软件包索引(如果您最近没有这样做的话):
- sudo apt update sudo apt更新
Then install the mysql-server
package:
然后安装mysql-server
软件包:
- sudo apt install mysql-server sudo apt安装mysql服务器
第2步-配置MySQL (Step 2 — Configuring MySQL)
Run MySQL’s included security script with sudo
:
使用sudo
运行MySQL随附的安全脚本:
- sudo mysql_secure_installation 须藤mysql_secure_installation
This will take you through a series of prompts where you can make some changes to your MySQL installation’s security options