sample my.cnf format for Azure database for mysql

Fiyin 1 Reputation point
2021-06-28T22:57:40.677+00:00

Is there a sample document that shows how to configure the user parameter in the .my.cnf file? I can't get this to work

[client]
host=cluster-1234.mysql.database.azure.com
user=adm@cluster-1234

Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
711 questions
{count} votes

6 answers

Sort by: Most helpful
  1. Fiyin 1 Reputation point
    2021-07-01T16:31:50.883+00:00

    Hi @Oury Ba-MSFT ,

    DBAs and Sysadmins mostly use commandline to run different commands and scripts, using a config file prevents having to type username and password on the command prompt which can be visible when the history command is used to review past commands. A my.cnf file also allows for multiple credentials to be stored in a secure location so that I don't have to remember multiple usernames and passwords for different tasks as well as having to share the credentials with different users. Scheduled jobs in Cron is just a use case for the need for my.cnf file. There are other use cases as described above as well as tools and scripts that read the credentials from the my.cnf file. The username@hosting format of Azure MySQL database doesn't work.

    Thanks,
    Fiyin