Avoid placing password on command line with MySQL Utilities?



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 βˆ’

+---------------------------------------------+
| @@datadir                                   |
+---------------------------------------------+
| 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
password = "yourPassword"

[mysql]
user = root
password = "yourPassword"

[mysqldiff]
user = root
password = "yourPassword"

[mysqldump]
user = root
password = "yourPassword"
Updated on: 2020-06-29T08:04:20+05:30

217 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements