Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site-install fails, .my.cnf socket not overridden #2645

Closed
geek-merlin opened this issue Feb 28, 2017 · 2 comments
Closed

Site-install fails, .my.cnf socket not overridden #2645

geek-merlin opened this issue Feb 28, 2017 · 2 comments

Comments

@geek-merlin
Copy link
Contributor

geek-merlin commented Feb 28, 2017

Wow, this was hard to debug.

How to reproduce:

  • Have a .my.cnf that has a socket:3306 connection as default
  • Want to do a site-install on a 127.0.0.1:3307 network connection

Actual outcome:

$ drush si --db-url=mysql://foo:[email protected]:3307/db
You are about to CREATE the 'mediacp8_dev' database. Do you want to continue? (y/n): y
Failed to create database: ERROR 1045 (28000): Access denied for user 'foo'@'bar' (using password: YES)       [error]

Debug details:

sql-query: DROP DATABASE IF EXISTS mediacp8_dev; CREATE DATABASE mediacp8_dev /*!40100 DEFAULT CHARACTER SET utf8 */;       [notice]
[5.93 sec, 8.77 MB]
Executing: mysql --defaults-extra-file=/tmp/drush_llCT5s --database=information_schema --host=127.0.0.1 --port=3307 --silent  < /tmp/drush_HXI3kS
Failed to create database: ERROR 1045 (28000): Access denied for user 'foo'@'bar' (using password: YES)       [error]

Workaround:

  • Rename the .my.cnf while installing, then rename back

Proposed solution

  • Add something like socket="" or protocol=TCP to the mysql client options IF the DB server is not localhost (in this case 127.0.0.1)

Sounds insane?
This is the setup on uberspace.de hoster, which allows to have the distribution's standard legacy SQL version on socket localhost:3306 and D8-enabled bleeding edge MariaDB on TCP 127.0.0.1:3307.

@alexpott
Copy link
Contributor

alexpott commented Mar 1, 2017

This is covered by #2387

@geek-merlin
Copy link
Contributor Author

Thanks @alexpott for pointing this out. Looks good and is in master now. So closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants