74 lines
2.1 KiB
Plaintext
74 lines
2.1 KiB
Plaintext
---
|
|||
|
|
layout: docs
|
||
|
|
page_title: connect mysql - Command
|
||
|
|
description: >-
|
||
|
|
The "connect mysql" command performs a target authorization or consumes an existing authorization token, and then launches a proxied MySQL connection.
|
||
|
|
---
|
||
|
|
|
||
|
|
# connect mysql
|
||
|
|
|
||
|
|
Command: `boundary connect mysql`
|
||
|
|
|
||
|
|
The `connect mysql` command authorizes a session against a target and invokes a MySQL client for the connection.
|
||
|
|
The command fills in the local address and port.
|
||
|
|
|
||
|
|
@include 'cmd-connect-env-vars.mdx'
|
||
|
|
|
||
|
|
|
||
|
|
## Examples
|
||
|
|
|
||
|
|
The following example shows how to connect to a target with the ID `ttcp_eTcMueUYv` using a MySQL helper:
|
||
|
|
|
||
|
|
```shell-session
|
||
|
|
$ boundary connect mysql -target-id=ttcp_eTcZMueUYv \
|
||
|
|
-dbname=northwind \
|
||
|
|
-username=superuser \
|
||
|
|
-format=table
|
||
|
|
```
|
||
|
|
|
||
|
|
When prompted, you must enter the password for the user, "superuser":
|
||
|
|
|
||
|
|
<CodeBlockConfig hideClipboard>
|
||
|
|
|
||
|
|
```plaintext
|
||
|
|
Enter password:
|
||
|
|
Welcome to the MySQL monitor. Commands end with ; or \g.
|
||
|
|
Your MySQL connection id is 8
|
||
|
|
Server version: 8.0.30 MySQL Community Server - GPL
|
||
|
|
|
||
|
|
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
|
||
|
|
|
||
|
|
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
|
||
|
|
|
||
|
|
mysql>
|
||
|
|
```
|
||
|
|
|
||
|
|
</CodeBlockConfig>
|
||
|
|
|
||
|
|
## Usage
|
||
|
|
|
||
|
|
<CodeBlockConfig hideClipboard>
|
||
|
|
|
||
|
|
```shell-session
|
||
|
|
$ boundary connect mysql [options] [args]
|
||
|
|
```
|
||
|
|
|
||
|
|
</CodeBlockConfig>
|
||
|
|
|
||
|
|
@include 'cmd-connect-command-options.mdx'
|
||
|
|
|
||
|
|
### MySQL options:
|
||
|
|
|
||
|
|
- `-dbname` `(string: "")` - The database name you want to pass through to the client.
|
||
|
|
You can also specify the database name using the **BOUNDARY_CONNECT_DBNAME** environment variable.
|
||
|
|
|
||
|
|
- `-style` `(string: "")` - How the CLI attempts to invoke a MySQL client.
|
||
|
|
This value also sets a suitable default for `-exec`, if you did not specify a value.
|
||
|
|
The default and currently-understood value is `mysql`.
|
||
|
|
You can also specify how the CLI attempts to invoke a MySQL client using the **BOUNDARY_CONNECT_MYSQL_STYLE** environment variable.
|
||
|
|
|
||
|
|
- `-username` `(string: "")` - The username you want to pass through to the client.
|
||
|
|
This value may be overridden by credentials sourced from a credential store.
|
||
|
|
You can also specfiy a username using the **BOUNDARY_CONNECT_USERNAME** environment variable.
|
||
|
|
|
||
|
|
@include 'cmd-option-note.mdx'
|