How To configure mysql_config_editor in mysql 5.7
How To configure mysql_config_editor in mysql 5.7
Whenever you want to connect to the MySQL server using the mysql client, you need to provide the password.
To avoid entering the password every time you connect to the MySQL server, you can use the mysql_config_editor utility program.
The mysql_config_editor utility program encrypts and stores MySQL credentials in a file named .mylogin.cnf in a directory, depending on the operating system:
In Window file location:-
Windows C:\Users\<username>\AppData\Roaming\MySQL\.mylogin.cnf
In linux based operation file location:-
macOS and Linux ~/.mylogin.cnf
Each set of credentials is referred to as a login path, which includes information such as the username, password, hostname, and port for connecting to a MySQL server.
The mysql client automatically uses the information stored in the .mylogin.cnf file to facilitate logins.
To specify which login path to use, you can use the --login-path parameter for the mysql client. If you don’t provide any login path, the mysql client will use the client login path by default.
Defining credentials by creating a new login path
To create a new login path, you use the following syntax:
mysql_config_editor set [options]
Code language: SQL (Structured Query Language) (sql)
The options include:
- --login-path=: The label for the credentials.
- --user=: The account username.
- --password: Flag to prompt for a password securely.
- --host=: The MySQL server’s hostname or IP address.
- --port=: The port number where the MySQL server is listening.
- --socket=: The path to the local socket file if connecting to a local server through Unix sockets.
Comments
Post a Comment