Skip to content

Instantly share code, notes, and snippets.

@lfryc
Last active August 29, 2015 14:11
Show Gist options
  • Save lfryc/f9202da17f734933f471 to your computer and use it in GitHub Desktop.
Save lfryc/f9202da17f734933f471 to your computer and use it in GitHub Desktop.
Easy MySQL in Docker
docker build -t easymysql github.com/nkratzke/easymysql
docker run -it -p 3306:3306 -e user="someuser" -e password="somepassword" -e right="WRITE" easymysql
#### second console:
### mind to change IP address to the docker address
docker run -it easymysql /bin/bash
root@408ffa1f5036:/# mysql -h 172.17.42.1 -u someuser -p
### mind to change IP address to the docker address
### aerogear ups 1.0.x
mysql> create database unifiedpush default character set = "UTF8" default collate = "utf8_general_ci";
mysql> create user 'unifiedpush'@'172.17.42.1' identified by 'unifiedpush';
mysql> GRANT SELECT,INSERT,UPDATE,ALTER,DELETE,CREATE,DROP ON unifiedpush.* TO 'unifiedpush'@'172.17.42.1';h
### aerogaer ups 1.1.x
mysql> create database unifiedpush default character set = "UTF8" default collate = "utf8_general_ci";
mysql> create database keycloak default character set = "UTF8" default collate = "utf8_general_ci";
mysql> create user 'unifiedpush'@'172.17.42.1' identified by 'unifiedpush';
mysql> GRANT SELECT,INSERT,UPDATE,ALTER,DELETE,CREATE,DROP ON unifiedpush.* TO 'unifiedpush'@'172.17.42.1';
mysql> GRANT SELECT,INSERT,UPDATE,ALTER,DELETE,CREATE,DROP ON keycloak.* TO 'unifiedpush'@'172.17.42.1';
### notes
Based on https://aerogear.org/docs/unifiedpush/ups_userguide/index/#_mysql_database
Inspired by http://www.nkode.io/2014/09/12/easymysql.html
@lfryc
Copy link
Author

lfryc commented Apr 16, 2015

For postgres, once can use: https://registry.hub.docker.com/_/postgres/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment