인디노트

MySQL 초기 비밀번호 확인 및 변경 (초기화) 본문

개발 플랫폼 및 언어

MySQL 초기 비밀번호 확인 및 변경 (초기화)

인디개발자 2018. 4. 25. 16:46
  1. MySQL Server Initialization (for MySQL 5.7 only): At the initial start up of the server, the following happens, given that the data directory of the server is empty:

    • The server is initialized.

    • An SSL certificate and key files are generated in the data directory.

    • The validate_password plugin is installed and enabled.

    • A superuser account 'root'@'localhost' is created. A password for the superuser is set and stored in the error log file. To reveal it, use the following command:

      shell> sudo grep 'temporary password' /var/log/mysqld.log

      Change the root password as soon as possible by logging in with the generated, temporary password and set a custom password for the superuser account:

      shell> mysql -uroot -p
      mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
    Note

    MySQL's validate_password plugin is installed by default. This will require that passwords contain at least one upper case letter, one lower case letter, one digit, and one special character, and that the total password length is at least 8 characters.

  2. Securing the MySQL Installation (for MySQL 5.6 only)

    The program mysql_secure_installation allows you to perform important operations like setting the root password, removing anonymous users, and so on. Always run it to secure your MySQL 5.6 installation:

    shell> mysql_secure_installation

    It is important to remember the root password you set. See mysql_secure_installation — Improve MySQL Installation Security for details.

    Do not run mysql_secure_installation after an installation of MySQL 5.7, as the function of the program has already been performed by the Yum repository installation.

Note

For EL7-based platforms: See Compatibility Information for EL7-based platforms.



반응형
Comments