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:
- Open the terminal and enter the following command to update the system package list:
sudo apt update
- Please enter the following command to install MySQL Server:
sudo apt install mysql-server
- During the installation process, you will be asked to set a password for the MySQL root user. Enter the password as instructed and confirm.
- After installation, start the MySQL service and set it to start automatically at boot.
sudo systemctl start mysql
sudo systemctl enable mysql
- You can use the following command to check the status of the MySQL service:
sudo systemctl status mysql
- 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.