Skip to content

Instantly share code, notes, and snippets.

@hung119
Last active April 11, 2019 11:29
Show Gist options
  • Save hung119/c52b8cd503bc197e10db5b76d0363568 to your computer and use it in GitHub Desktop.
Save hung119/c52b8cd503bc197e10db5b76d0363568 to your computer and use it in GitHub Desktop.

Revisions

  1. hung119 revised this gist Apr 11, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docker_mysql.txt
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ docker pull mysql
    mkdir -p /var/lib/mysql/mysql_docker
    docker run --name mysql-5.7.24 -v /var/lib/mysql/mysql_docker:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 --restart always -p 3307:3306 -d mysql:5.7.24

    docker exec -it mysql mysql -h127.0.0.1 -P3306 -uroot -p123456 \
    docker exec -it mysql-5.7.24 mysql -h127.0.0.1 -P3306 -uroot -p123456 \
    CREATE DATABASE aps /*\!40100 DEFAULT CHARACTER SET ${charset} */;
    CREATE USER hieunt@'%' IDENTIFIED BY 'hieunt123#@!';
    GRANT ALL PRIVILEGES ON aps.* TO 'hieunt'@'%';
  2. hung119 created this gist Nov 27, 2018.
    15 changes: 15 additions & 0 deletions docker_mysql.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #https://github.com/sameersbn/docker-mysql
    #https://hub.docker.com/_/mysql/
    #https://dev.mysql.com/doc/mysql-installation-excerpt/5.5/en/docker-mysql-getting-started.html
    #https://hub.docker.com/r/mysql/mysql-server/
    #https://hub.docker.com/r/_/mysql/
    #Docker Pull Command
    docker pull mysql

    mkdir -p /var/lib/mysql/mysql_docker
    docker run --name mysql-5.7.24 -v /var/lib/mysql/mysql_docker:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 --restart always -p 3307:3306 -d mysql:5.7.24

    docker exec -it mysql mysql -h127.0.0.1 -P3306 -uroot -p123456 \
    CREATE DATABASE aps /*\!40100 DEFAULT CHARACTER SET ${charset} */;
    CREATE USER hieunt@'%' IDENTIFIED BY 'hieunt123#@!';
    GRANT ALL PRIVILEGES ON aps.* TO 'hieunt'@'%';