Install MySQL database on CentOS7.

To install MySQL database on CentOS 7, follow the steps below:

  1. Open the terminal and log in with the root user.
  2. Run the following command to update the system software packages:
  3. update the system with yum
  4. Run the following command to install the MySQL database server:
  5. install the mysql-server package using yum
  6. Start the MySQL service after installation is complete.
  7. Start the mysqld service using systemctl.
  8. Run the following command to set up the MySQL service to automatically start on system boot:
  9. Enable the mysqld service using systemctl.
  10. Execute the following command to enhance the security of your MySQL database:
  11. Make MySQL installation more secure
  12. This command will prompt you to set a password for the root user and provide other security options such as removing anonymous users and disabling remote root login.
  13. After completing the security setup, you can use the following command to check the status of the MySQL service:
  14. Check the status of the MySQL service.

You have now successfully installed and configured the MySQL database server. You can log in to the MySQL database using the following command:

mysql -u root -p

Afterward, you can log in by entering the root user password that was set before.

Leave a Reply 0

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


广告
Closing in 10 seconds
bannerAds