MySQL 8.0 Database Administrator — Question 116
You wish to store the username and password for a client connection to MySQL server in a file on a local file system.
Which is the best way to encrypt the file?
Answer options
- A. Use the AES_ENCRYPT() MySQL function on the option file.
- B. Use mysql_secure_installation to encrypt stored login credentials.
- C. Use a text editor to create a new defaults file and encrypt it from Linux prompt.
- D. Use mysql_config_editor to create an encrypted file.
Correct answer: D
Explanation
The correct answer is D because mysql_config_editor is specifically designed to create and manage encrypted login credentials for MySQL connections. Option A, while it provides encryption, does not specifically address the needs of storing credentials securely in a file. Option B relates to securing the MySQL installation rather than encrypting user credentials in a file. Option C lacks a specific mechanism for encryption and relies on manual methods, which are less secure.