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.

Step-1.Checked the any mysql config file created or not.





step.2.create my.cnf  encrypted file using mysql_config_editor.

 mysql_config_editor set --user=root --password --host=xx.xx.xx.xx--login-path=test



step.3.check my.cnf file using command line.

 mysql_config_editor print --all



step.4. Reset all mysql config editor.

 mysql_config_editor reset





Comments

Popular posts from this blog

MySQL Replication Switchover: Step-by-Step Guide

How to create database manually in oracle 11g R2

How To Install and Configure Innodb Cluster /shell/Router