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

Using .mylogin.cnf for a mysql connection #45

Closed
trallarn opened this issue Jun 18, 2019 · 3 comments
Closed

Using .mylogin.cnf for a mysql connection #45

trallarn opened this issue Jun 18, 2019 · 3 comments

Comments

@trallarn
Copy link

First of all, thanks for the great work with this plugin!

In order to use encrypted password for a mysql connection I'm using .mylogin.cnf. To use a connection from this configuration file from the shell I would use
mysql --login-path=<entry-in-config>

Is there any way to supply the login-path flag using dadbod?

Thanks!

@trallarn trallarn changed the title Using .mylogin.cnf Using .mylogin.cnf for a mysql connection Jun 18, 2019
@tpope
Copy link
Owner

tpope commented Jun 19, 2019

Not currently supported. Is there a way to check if <entry-in-config> actually exists in the config? I think it might make sense for mysql:<entry-in-config> to work if it's there, but fallback to treating it as a hostname if not.

@trallarn
Copy link
Author

trallarn commented Jun 20, 2019

That sounds like a good approach.

An entry in .mylogin.cnf does not contain the actual database so if possible it would be nice if dadbod would still extract that from the url, like so mysql:<entry-in-config>/<database>.

This is how one can check if an entry exists in the config:

$ mysql_config_editor print --login-path test
[test]
user = test-user
password = *****
host = test

You add an entry by:

$ mysql_config_editor  set --login-path=test --host=test --user=test-user --password

@tpope tpope closed this as completed in f8c249a Jun 26, 2019
@tpope
Copy link
Owner

tpope commented Jun 26, 2019

Eh that's a bit less intuitive, going for a query param for now because that's easy to implement.

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