# Avoid placing password on command line with MySQL Utilities?

MySQLMySQLi Database

First you need to reach the location of “my.cnf” with the help of below query for MySQL Utilities. The query is as follows −

mysql> select @@datadir;

The following is the output that display where “my.conf” is −

+---------------------------------------------+
+---------------------------------------------+
| C:\ProgramData\MySQL\MySQL Server 8.0\Data\ |
+---------------------------------------------+
1 row in set (0.00 sec)

Follow the above path in order to open the “my.cnf” file. The snapshot of “my.cnf” location is as follows −

Now you can put the below MySQL Utilities in my.cnf which is as follows −

[client]
user = root

[mysql]
user = root
password = "yourPassword"