How do you install MySQL on a Linux system?

The usual method for installing MySQL on a Linux system is through package management tools. The specific steps are as follows:

  1. Open the terminal and enter the following command to update the system package list:
sudo apt update
  1. Please enter the following command to install MySQL Server:
sudo apt install mysql-server
  1. During the installation process, you will be asked to set a password for the MySQL root user. Enter the password as instructed and confirm.
  2. After installation, start the MySQL service and set it to start automatically at boot.
sudo systemctl start mysql
sudo systemctl enable mysql
  1. You can use the following command to check the status of the MySQL service:
sudo systemctl status mysql
  1. Finally, you can log into the MySQL database server using the following command:
mysql -u root -p

To login to the MySQL database server, simply enter the newly set root user password.

The above are the simple steps for installing MySQL on a Linux system, specific operations may vary depending on the different distributions of Linux.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds