Specify mysql socket in Hanami

Do this

Hanami :: Model internally calls ROM (ruby orm)

Can be passed with query parameter


DATABASE_URL="mysql2://root:password@host/database?socket=/mysql/mysql.sock"

reference

https://rom-rb.org/learn/sql/3.2/#mysql

Hanami on Cloud Run

This time I had to specify socket to connect to cloud sql on GCP cloud run

Connect via cloud sql proxy


DATABASE_URL="mysql2://root:password@host/database?socket=/cloudsql/<DATABASE_CONNECTION_NAME>"

Hanami has little literature, so let's actively output it.

Recommended Posts

Specify mysql socket in Hanami
Specify the java location in eclipse.ini
Commands often used in MySQL operations
Store UUID data in MySQL in 16 bytes
Check MySQL logs in Docker environment