Files
threshold/website/content/docs/commands/connect/mysql.mdx
T
8b8fb28228 feat: add MySQL command support PORT (#5891)
* feat: add MySQL command support

* Fix MySQL connection according to review feedback

* Update internal/cmd/commands/connect/mysql.go

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>

* Update internal/cmd/commands/connect/mysql.go

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>

* Update internal/cmd/commands/connect/mysql.go

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>

* feat: add MySQL support to boundary connect

* docs: add MySQL to navigation menu

   Fixes content check error by adding mysql.mdx to docs navigation.
   MySQL page now appears in Commands > connect section alongside postgres.

* Update testing/internal/e2e/tests/base_plus/target_tcp_connect_mysql_test.go

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>

* test: add containerized MySQL connection test for target functionality

* Remove MySQL environment variables from e2e test config

* test: move MySQL e2e test from base_plus to base folder

* Fix MySQL test to support both MySQL and MariaDB clients

* Fix MySQL test to support both MySQL and MariaDB clients

* lint cleanup

* adding error checks

* Make gen

* Test case testing

* Reverting bad comment

* cleaning up extra test file

* Add Mysql to runner (#5893)

* Adding back correct test file

* Removing base plus test file

* Removing base plus test file

* Revert "Removing base plus test file"

This reverts commit ace9cb3e90a028adc1f7c8ef55436ca843abfc15.

* forcing enos docker network name

* Revert "forcing enos docker network name"

This reverts commit 631bdb4a0ef87f5435e06456e8ec0a4573ab3e49.

* changing hosts to looks for sql container

* fix container name

* Adjusting for e2e tests and a bit of cleanup

* missed a commented string

* Bgajjala mysql e2etest v2 (#5900)

* Using Env Vars rather than parsing uri

* Comments fix

* spacing

* Update testing/internal/e2e/tests/base/target_tcp_connect_mysql_test.go

* Spacing

* Update internal/cmd/commands/connect/mysql.go

* adding error checks

* Make gen

* Update testing/internal/e2e/tests/base/target_tcp_connect_mysql_test.go

* Update internal/cmd/commands/connect/mysql.go

* Make gen

* derving target port from uri

* nit

* updating test to use url strings

* nit: spacing

* nit: code organization

* nit: code organization
Co-authored-by: Enbiya Göral

---------

Co-authored-by: Enbiya <menbiyagoral@gmail.com>
Co-authored-by: Enbiya Göral <100806254+enbiyagoral@users.noreply.github.com>
Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Co-authored-by: Ryan Derr <54389874+RyanDerr@users.noreply.github.com>
2025-07-08 17:07:27 -05:00

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'