logo

Mysql

Connect to a private mysql instance from your favorite IDE

Connect to MySQL

Open a new terminal and type
plain text
hoop connect mysqldb
plain text
connection: mysqldb | session: 0ebc7492-94bf-498e-ac9c-430f2d5e89b0 ---------------------mysql-credentials---------------------- host=127.0.0.1 port=5433 user=noop password=noop ------------------------------------------------------------ ready to accept connections!

Use It

Connect to mysql using any IDE, example:
plain text
mysql -h 0 -p 3307

mysql cli

An optional way to connect into MySQL is using the mysql client. It’s possible to create a interactive session or execute one-off commands.

Connection Configuration

Name
Type
Description
HOST
env-var
The IP or Host of the MySQL server
PORT
env-var
The port of the MySQL server
USER
env-var
The user to connect in the MySQL server
MYSQL_PWD
env-var
The password to connect in the MySQL server
DB
env-var
The name of the database to connect into

Connection Command

plain text
mysql -h$HOST -u$USER --port=$PORT -D$DB
:::info NOTE The MYSQL_PWD is mapped as an environment variable, thus there’s no need to use it in the command. :::

How to Use

Start an interactive session with mysql client
plain text
hoop connect mysql
In the same connection, one-off process can be run as well
plain text
hoop exec mysql <<EOF SELECT SLEEP(2); SELECT NOW(); EOF
plain text
hoop exec mysql -f /tmp/myquery.sql hoop exec psql -i 'SELECT NOW()'

Powered by Notaku