Last active
August 29, 2015 14:11
-
-
Save lfryc/f9202da17f734933f471 to your computer and use it in GitHub Desktop.
Easy MySQL in Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For postgres, once can use: https://registry.hub.docker.com/_/postgres/