To initialize MySQL on CentOS 7, you can follow these steps:

  1. Install MySQL by running the following command:

    sudo yum install mysql-server
    
  2. Start the MySQL service by running the following command:

    sudo systemctl start mysqld
    
  3. Run the MySQL secure installation script to set a root password and secure the installation:

    sudo mysql_secure_installation
    

    This script will guide you through setting a root password, removing anonymous users, disallowing remote root login, and removing test databases.

  4. Enable the MySQL service to start on boot by running the following command:

    sudo systemctl enable mysqld
    
  5. Verify that the MySQL service is running by running the following command:

    sudo systemctl status mysqld
    

    If the service is running, you should see an output indicating that it is active (running).

That's it! You have successfully initialized MySQL on CentOS 7

CentOS 7 初始化mysql

原文地址: http://www.cveoy.top/t/topic/iXTS 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录