Mysql Login Path Setup
If you haven’t set this up for your user on the server:
mysql_config_editor set -h localhost -G prod -u root -p
...and supply the MySQL root user’s password when prompted. Then repeat this for each environment, changing the -G flag for each: prod, dev, and stage.