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

Make "localhost" the default database host form value #12584

Conversation

florianjacob
Copy link
Contributor

for new installations, replacing 127.0.0.1 to support MySQL / MariaDB unix user authentication
out of the box.

Unix Socket Authentication does not work when the database host is given as 127.0.0.1, like the current default.

For the NixOS Linux distribution, I apply this patch downstream so that users only need to fill in matomo as username without creating, copying and storing a MySQL / MariaDB user pasword and are done.

This of course would require localhost to be defined somehow, but I never saw a distribution where there wasn't an entry e.g. in /etc/hosts.

Note that this is only affecting new installations, and if the database connection would fail, it could still be changed by the user to 127.0.0.1 or whatever they need.

for new installations, replacing 127.0.0.1 to support MySQL / MariaDB unix user authentication
out of the box.
@robocoder
Copy link
Contributor

robocoder commented Mar 24, 2018

The converse is also true. Leave it as 127.0.0.1 and if it doesn't work, change it to localhost.

@robocoder
Copy link
Contributor

Ref #1642

@robocoder
Copy link
Contributor

A better idea might be for the installer to automatically figure out the right connection method.

@florianjacob
Copy link
Contributor Author

Thanks! Did not know about the special mysql semantics for localhost (that it will result in using unix sockets), but now I see how the Unix socket authentication actually works and why it needs localhost.

I agree, the way to go is having the installer check whether it can connect via unix socket or tcp socket and fill in the first that works, or nothing if there is no local mysql server. I'll open an issue and document this, as I'm not sure whether I can figure that out.

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

Successfully merging this pull request may close these issues.

None yet

2 participants