Skip to content

MySQL Protocol Configuration

The MySQL listener of HeliosDB Full is configured with heliosdb-full startup flags and environment variables. There is no [mysql] section in the config file: the server reads only [storage] keys from it and refuses to start when a file sets keys it does not honour.

Enabling the listener

SettingFlagEnvironment variableDefault
Enable--enable-mysql—off
Port--mysql-portHELIOSDB_MYSQL_PORT3306
Bind address (all listeners)--bind-addrHELIOSDB_BIND_ADDR127.0.0.1
Allow a non-loopback bind--allow-externalHELIOSDB_ALLOW_EXTERNALoff
Connections (all listeners)--max-connectionsHELIOSDB_MAX_CONNECTIONS10000
New connections per client IP--conn-rate-limitHELIOSDB_CONN_RATE_LIMIT500 per minute
Terminal window
heliosdb-full --data-dir /var/lib/heliosdb --enable-mysql
# MySQL protocol listening on 127.0.0.1:3306
# Another port, reachable from a private network
heliosdb-full --data-dir /var/lib/heliosdb --enable-mysql --mysql-port 3307 \
--bind-addr 10.0.0.12 --allow-external

In a container, append --enable-mysql after the image name and publish the port (-p 127.0.0.1:3306:3306).

Authentication

The MySQL listener looks users up in the server’s role catalog, the same roles PostgreSQL clients log on with:

  • the built-in superuser postgres
  • roles created over PostgreSQL: CREATE ROLE app LOGIN PASSWORD '...'

Clients may use the caching_sha2_password (MySQL 8 default) or mysql_native_password plugin; other plugins are refused. Unknown users and empty passwords are refused. --auth-mode trust does not apply to this listener.

TLS

The MySQL listener does not offer TLS. Keep it on loopback or a private network and restrict port 3306 with a firewall, or reach it through an SSH or TLS tunnel. Clients that require TLS (--ssl-mode=REQUIRED) cannot connect; the default PREFERRED mode connects without it.

Connecting

Terminal window
mysql -h 127.0.0.1 -P 3306 -u app -p postgres
import os, pymysql
conn = pymysql.connect(host="127.0.0.1", port=3306, user="app",
password=os.environ["APP_PASSWORD"], database="postgres")
String url = "jdbc:mysql://127.0.0.1:3306/postgres?sslMode=DISABLED";
Connection conn = DriverManager.getConnection(url, "app", System.getenv("APP_PASSWORD"));

Statements run on the same SQL engine as the PostgreSQL listener and see the same tables. MySQL-specific functions and syntax may need small changes; test your application’s statements against a non-production server.