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

Add documentation about --login-path. #15

Merged
merged 1 commit into from
Aug 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ docs/_build/
target/

output

# PyCharm
.idea/
7 changes: 7 additions & 0 deletions content/pages/3.docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ through the matches by pressing `<C-r>` again.

[Read more...]({filename}/pages/history.md)

## [Working with multiple servers]({filename}/pages/loginpath.md)<a name="loginpath"></a>

When working with multiple servers, it is possible to store their connection parameters using
`mysql_config_editor`, and connect providing `--login-path <name> <database>` with a server alias.

[Read more...]({filename}/pages/loginpath.md)

## [Pager Output]({filename}/pages/pager.md)<a name="pager"></a>

`Mycli` uses pager programs to make it easier to view large result sets. This
Expand Down
22 changes: 22 additions & 0 deletions content/pages/loginpath.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Title: Storing server configuration
Slug: loginpath
status: hidden


When working with multiple servers, it is advisable to use the
[`mysql_config_editor`](https://dev.mysql.com/doc/refman/5.7/en/mysql-config-editor.html)
tool that ships with MySQL to store the authentication credentials in an encrypted file called
`.mylogin.cnf`. Then, `mycli` can read and use those credentials.

First, run the `mysql_config_editor` tool and enter the credentials:

```
$ mysql_config_editor set --login-path=my_server_alias --host=my.host.address --user=myusername --password
Enter password: *****
```

Then, provide the `--login-path` option when running `mycli`:

```
$ mycli --login-path my_server_alias my_database_name
```