[Linux] MySQL database installation and configuration tutorial (Ubuntu 22.04)

Preface

MySQL is a popular open source relational database management system (RDBMS) that is widely used for back-end data storage in web applications, such as many dynamic websites, e-commerce systems, and online publications.

MySQL has the characteristics of high performance, reliability and ease of use. It supports large databases and provides a series of advanced functions and management tools, such as transaction processing, triggers, stored procedures, etc. MySQL also has a free and open source community version and a commercial version, which are suitable for different usage scenarios and support needs. MySQL is widely used in Internet and enterprise applications and is one of the most popular relational database management systems.


step

  1. Update system package list
sudo apt update
  1. Install MySQL server
sudo apt install mysql-server
  1. Using the MySQL Security Configuration Tool
sudo mysql_secure_installation

This tool will prompt you to perform some basic security configurations, just follow the prompts.

  • Set up the "VALIDATE PASSWORD" component to enhance password security?
    Password security

  • Delete anonymous users?
    Delete anonymous user

  • Are root remote logins prohibited?
    Disable root remote login

  • Drop the test database and access it?
    Delete test database

  • Do you want to reload the permissions table now?
    Reload permissions table

  1. Check if the MySQL service is running:
sudo systemctl status mysql

If the MySQL service is running, you will see output similar to the following:

MySQL service running status

If the MySQL service is not running, you can start it using the following command:

sudo systemctl start mysql

In this way, you have successfully installed the latest version of MySQL server.

おすすめ

転載: blog.csdn.net/qq_34988204/article/details/135027199