You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Drush uses --defaults-extra-file when connecting to database for storing username&password. If current user has .my.cnf in his/her home folder it will override --defaults-extra-file.
When connecting to MySQL drush will create tmp file with following context:
#This file was written by Drush's Sqlmysql.inc.
[client]
user="dev_user"
password="dev_password"
And it uses it like: mysql --defaults-extra-file=<previously created tmp file> --database=dev_base --host=localhost --silent
Because .my.cnf overrides --defaults-extra-file previous command will try to connect with user my_user and if my_user doesn't have permissions to access database drush will fail to connect to database.
The text was updated successfully, but these errors were encountered:
This is not a good enough answer. Scripts on the server setups I have already use .my.cnf for doing a lot of tasks. Drupal's database is on another machine. Drush needs a way to disable this functionality and it's bad it was ever added. It's been very disruptive see: https://www.drupal.org/project/drush/issues/2852233 #2750 #2183
Drush uses --defaults-extra-file when connecting to database for storing username&password. If current user has .my.cnf in his/her home folder it will override --defaults-extra-file.
Example:
settings.php found in sites/default
~/.my.cnf
When connecting to MySQL drush will create tmp file with following context:
And it uses it like:
mysql --defaults-extra-file=<previously created tmp file> --database=dev_base --host=localhost --silent
Because .my.cnf overrides --defaults-extra-file previous command will try to connect with user my_user and if my_user doesn't have permissions to access database drush will fail to connect to database.
The text was updated successfully, but these errors were encountered: