Categories
docker sql

Docker: MySQL

https://hub.docker.com/r/mysql/mysql-server/ Download docker pull mysql/mysql-server:latest Create Option 1 – docker run docker run -d \ –name mysql-itsmetommy \ -p 3306:3306 \ –env=”MYSQL_ROOT_PASSWORD=password” \ mysql/mysql-server:latest Option 2 – docker-compose cat <<EOF > docker-compose.yml version: ‘3.8’ services: db: image: mysql:latest restart: always environment: MYSQL_DATABASE: ‘db’ # Optional user account MYSQL_USER: ‘tommy’ # Password for optional user account […]

Categories
postgresql sql

Securing PostgreSQL using Host Based Authentication (HBA)

HBA stands for Host-base Authentication. The pg_hba.conf config file controls the authentication method. By default, local connections to Postgres uses peer authentication. That means that instead of asking you for a password, it checks to see if you are currently logged in as a system user that matches the user name in Postgres. This is where […]