Linux is a very popular operating system that is widely used in various servers and development environments. In Linux, MySQL is one of the most popular relational databases, and it is very convenient to use the yum command to install MySQL in Linux.
The following are the steps to use yum to install the MySQL database in a Linux system.
sudo yum localinstall https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
sudo yum update
sudo yum search mysql
sudo yum install mysql-community-server
sudo systemctl start mysqld
sudo systemctl status mysqld
sudo mysql_secure_installation
The script will guide you through a series of MySQL configuration options. For example, you can reset the root account password to improve database security. Additionally, you can choose to delete anonymous users and test databases to improve the security of your system.
sudo mysql -u root -p
You will be prompted for the password for MySQL root. If you have successfully logged in, you will be able to perform various operations using MySQL's command line interface.
In short, using yum to install MySQL in Linux is a very simple task. Using the above steps you will be able to quickly and easily install MySQL, configure security, and start using this popular relational database.
The above is the detailed content of How to use yum command to install MySQL in Linux. For more information, please follow other related articles on the PHP Chinese website!