This question is related to another question I subsequently asked here: Using the output from mysqldiff.exe to transform database2 to match database1.
I have been trying to use mysqldiff.exe
, part of MySQL Utilities
group of tools. The idea is to identify schema differences between two databases, or other contained objects (tables, routines, triggers, etc).
Basically this command:
mysqldiff.exe --server1=root:password@localhost:3306
--server2=root:password@localhost:3306 db1:db2
seems to work, though I'm yet to fully grasp how to use this program's output for the purpose of transforming the one db to match the other! I guess I might have to ask that question differently further down the line.
My immediate issue is:
This utility screams: # WARNING: Using a password on the command line interface can be insecure.
, yet I am unable to find a means to avoid spilling out my passwords out there! There is no such option from the available help.
With regular MySQL binaries (mysqld.exe
, mysql
, mysqladmin
, etc), I am able to use --login-path=xxxx
, having configured the credentials using mysql_config_editor.exe
. With Mysql Utilities
, how can I solve this issue?
PS: I realize that my question's tags are a bit imprecise, but I stuff like "mysql-utilities" and "mysqldiff" are not available!
Best Answer
You can put the password in the my.cnf (or my.ini for Windows) and then login without specifying the password "over the wire". Obviously you want to keep that file secure, but in any decent setup, this should not be a problem.
LOGGING IN
CONTENTS OF MY.INI OR MY.CNF
PASSWORD NOT VISIBLE