{"id":4576,"date":"2016-08-23T13:38:49","date_gmt":"2016-08-23T04:38:49","guid":{"rendered":"http:\/\/www.lancard.com\/blog\/?p=4576"},"modified":"2025-03-12T11:27:07","modified_gmt":"2025-03-12T02:27:07","slug":"docker%e5%85%ac%e5%bc%8f%e3%82%a4%e3%83%a1%e3%83%bc%e3%82%b8%e3%81%a7%e9%96%8b%e7%99%ba%e7%94%a8rdb%e3%82%92%e3%82%b2%e3%83%83%e3%83%88%e3%81%a0%e3%81%9cmariadb%e3%80%81percona-server%e7%b7%a8","status":"publish","type":"post","link":"https:\/\/www.lancard.com\/blog\/2016\/08\/23\/docker%e5%85%ac%e5%bc%8f%e3%82%a4%e3%83%a1%e3%83%bc%e3%82%b8%e3%81%a7%e9%96%8b%e7%99%ba%e7%94%a8rdb%e3%82%92%e3%82%b2%e3%83%83%e3%83%88%e3%81%a0%e3%81%9cmariadb%e3%80%81percona-server%e7%b7%a8\/","title":{"rendered":"Docker\u516c\u5f0f\u30a4\u30e1\u30fc\u30b8\u3067\u958b\u767a\u7528RDB\u3092\u30b2\u30c3\u30c8\u3060\u305c(MariaDB\u3001Percona Server\u7de8)"},"content":{"rendered":"<h1>\u307e\u3048\u304c\u304d<\/h1>\n<p><a href=\"http:\/\/www.lancard.com\/blog\/?p=4470\">Docker\u516c\u5f0f\u30a4\u30e1\u30fc\u30b8\u3067\u958b\u767a\u7528RDB\u3092\u30b2\u30c3\u30c8\u3060\u305c(PostgreSQL\u7de8)<\/a><br \/>\n<a href=\"http:\/\/www.lancard.com\/blog\/?p=4482\">Docker\u516c\u5f0f\u30a4\u30e1\u30fc\u30b8\u3067\u958b\u767a\u7528RDB\u3092\u30b2\u30c3\u30c8\u3060\u305c(MySQL\u7de8)<\/a><\/p>\n<p>\u306b\u7d9a\u304d\u4e88\u5b9a\u3069\u304a\u308aMariaDB\u7de8\u3092\u304a\u9001\u308a\u3057\u307e\u3059\u3002\u4e00\u8a00\u3067\u6e08\u3080\u306e\u3067\u7d50\u8ad6\u3092\u66f8\u304f\u3068<\/p>\n<p><strong>\u300c\u516c\u5f0f\u30a4\u30e1\u30fc\u30b8\u306e\u30da\u30fc\u30b8\u3092\u8aad\u307f\u6bd4\u3079\u305f\u3089MySQL\u3068\u540c\u3058\u3067\u3057\u305f\u3002\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u300d<\/strong><\/p>\n<p>\u3068\u3044\u3046\u5185\u5bb9\u3067\u3059\u3002\u3064\u3044\u3067\u306b<\/p>\n<blockquote class=\"twitter-tweet\" data-lang=\"ja\">\n<p lang=\"ja\" dir=\"ltr\">Docker Hub \u3067 Official\u7e1b\u308a\u3067MySQL\u3092\u691c\u7d22\u3057\u305f\u3089Percona\u3082\u51fa\u3066\u304d\u305f\u306e\u3067\u601d\u3044\u51fa\u3057\u305f\u308a\u3057\u305f\u3002\u5b9a\u671f\u7684\u306bPercona\u826f\u3055\u305d\u3046\u3060\u306a\u3041\u3068\u601d\u3063\u3066\u540d\u524d\u3092\u5fd8\u308c\u308b\u3092\u7e70\u308a\u8fd4\u3059\u5b58\u5728\u3002<\/p>\n<p>&mdash; murave (@murave) <a href=\"https:\/\/twitter.com\/murave\/status\/765360747887009793\">2016\u5e748\u670816\u65e5<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<p>\u3068\u3044\u3046\u308f\u3051\u3067Percona Server\u306e\u516c\u5f0f\u30a4\u30e1\u30fc\u30b8\u306e\u30da\u30fc\u30b8\u3082\u898b\u3066\u307f\u305f\u3089\u3053\u308c\u3082MySQL\u306e\u5834\u5408\u3068\u540c\u3058\u6271\u3044\u3067\u3057\u305f\u306e\u3067\u542b\u3081\u3066\u307f\u307e\u3057\u305f\u3088\u3002<\/p>\n<p>Docker for Mac\u3092\u4f7f\u7528\u3057\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p><!--more--><\/p>\n<h1>MySQL\u6d3e\u751fRDBMS\u9054\u306e\u516c\u5f0f\u30a4\u30e1\u30fc\u30b8<\/h1>\n<p>\u307e\u3048\u304c\u304d\u306b\u5f15\u7528\u3057\u305fTwitter\u306e\u3064\u3076\u3084\u304d\u306b\u3042\u308b\u3088\u3046\u306bDocker Hub\u3067Official\u7e1b\u308a\u3067MySQL\u3092\u691c\u7d22\u3057\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"http:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2016\/08\/83b0d04e2b872cb4d8b55a9cb9caa92e.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2016\/08\/83b0d04e2b872cb4d8b55a9cb9caa92e-400x241.jpg\" alt=\"Docker Hub\u3067Official\u7e1b\u308a\u3067MySQL\u3092\u691c\u7d22\" width=\"400\" height=\"241\" class=\"alignnone size-medium wp-image-4578\" srcset=\"https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2016\/08\/83b0d04e2b872cb4d8b55a9cb9caa92e-400x241.jpg 400w, https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2016\/08\/83b0d04e2b872cb4d8b55a9cb9caa92e-768x462.jpg 768w, https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2016\/08\/83b0d04e2b872cb4d8b55a9cb9caa92e-602x362.jpg 602w, https:\/\/www.lancard.com\/blog\/wp-content\/uploads\/2016\/08\/83b0d04e2b872cb4d8b55a9cb9caa92e.jpg 980w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><\/p>\n<p>\u3053\u306e\u69d8\u306b3\u4ef6\u5f15\u3063\u304b\u304b\u308a\u307e\u3059\u3002<\/p>\n<p>MariaDB\u3068Percona Server\u306fMySQL\u6d3e\u751f\u306eRDBMS\u3067\u3059\u3002\u6982\u8981\u3092\u3064\u304b\u307f\u3084\u3059\u3044\u304b\u3068\u601d\u3046\u30da\u30fc\u30b8\u3078\u306e\u30ea\u30f3\u30af\u3092\u3042\u3052\u3066\u304a\u304d\u307e\u3059\u306d\u3002<\/p>\n<p><a href=\"https:\/\/ja.wikipedia.org\/wiki\/MariaDB\" target=\"_blank\">MariaDB &#8211; Wikipedia<\/a><br \/>\n<a href=\"http:\/\/qiita.com\/mita2\/items\/70ca2dbe8f08e943c747\" target=\"_blank\">MySQL \u4e92\u63db\u306eDB\u3001Percona Server \u3092\u4f7f\u3046\u7406\u7531 &#8211; Qiita<\/a><\/p>\n<p>\u500b\u4eba\u7684\u306b\u3001\u3053\u308c\u304b\u3089\u306fMySQL\u3088\u308aMariaDB\u3092\u4f7f\u3046\u3053\u3068\u304c\u591a\u304f\u306a\u308a\u305d\u3046\u306b\u611f\u3058\u3066\u304a\u308a\u307e\u3059\u3057\u3001\u4ee5\u524d\u304b\u3089Percona Server\u306f\u826f\u3055\u305d\u3046\u3060\u3068\u601d\u3063\u3066\u3044\u307e\u3057\u305f(\u305d\u3057\u3066\u5fd8\u308c\u308b)\u3002<\/p>\n<p>\u3053\u308c\u3089\u306e\u516c\u5f0f\u30a4\u30e1\u30fc\u30b8\u306e\u30da\u30fc\u30b8\u3092\u8aad\u307f\u6bd4\u3079\u305f\u6240\u3001\u8a2d\u5b9a\u7528\u306e\u74b0\u5883\u5909\u6570\u306e\u540d\u79f0\u3082\u542b\u3081\u3066MySQL\u3068\u540c\u3058\u3067\u3001\u6271\u3044\u304b\u305f\u306f\u307b\u307c\u540c\u3058\u3068\u8003\u3048\u3066\u826f\u3044\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u308f\u3051\u3067\u3001\u8abf\u67fb\u306f\u3059\u3063\u3068\u3070\u3057\u3066MySQL\u7528\u306b\u4f5c\u6210\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u30d9\u30fc\u30b9\u306b\u30a4\u30e1\u30fc\u30b8\u306e\u65e5\u672c\u8a9e\u5316\u3068Docker Compose\u3067\u306e\u8d77\u52d5\u3092\u3057\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u57fa\u672c\u7684\u306b\u5909\u66f4\u70b9\u3060\u3051\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u306e\u3067\u30d9\u30fc\u30b9\u306b\u3064\u3044\u3066\u306f\u524d\u56deMySQL\u306e\u8a18\u4e8b\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>MariaDB<\/h2>\n<p><a href=\"https:\/\/hub.docker.com\/_\/mariadb\/\" target=\"_blank\">OFFICIAL REPOSITORY mariadb<\/a><\/p>\n<p>2016\u5e748\u6708\u4e2d\u65ec\u73fe\u5728\u306e\u5bfe\u5fdc\u30d0\u30fc\u30b8\u30e7\u30f3\u3002<\/p>\n<p>10.1(10.1.16), 10.0 (10.0.26), 5.5(5.5.51)<\/p>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u9078\u629e\u3055\u308c\u308blatest\u306f10.1\u7cfb\u3002\u4eca\u56de\u306f10.1\u7cfb\u3067\u9032\u3081\u307e\u3059\u3002<\/p>\n<h3>\u65e5\u672c\u8a9e\u5316\u3055\u308c\u305f\u30a4\u30e1\u30fc\u30b8\u306e\u4f5c\u6210<\/h3>\n<p>default locale\u3092\u8a2d\u5b9a\u3059\u308bDockerfile\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<p>Dockerfile<\/p>\n<pre><code>FROM mariadb:10.1\n\nMAINTAINER murave\n\nRUN apt-get update &amp;&amp; apt-get install locales -y &amp;&amp; localedef -i ja_JP -c -f UTF-8 -A \/usr\/share\/locale\/locale.alias ja_JP.UTF-8\nENV LANG ja_JP.utf8\n<\/code><\/pre>\n<p>\u65e5\u672c\u8a9e\u5316\u3055\u308c\u305f\u30a4\u30e1\u30fc\u30b8\u3001mariadb_jp:10.1\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<pre><code>$ docker build -t mariadb_jp:10.1 .\/\n<\/code><\/pre>\n<p>\u78ba\u8a8d<\/p>\n<pre><code>$ docker images\nREPOSITORY           TAG                 IMAGE ID            CREATED             SIZE\nmariadb_jp           10.1                3fa6fd548f5b        11 seconds ago      420.8 MB\nmariadb              10.1                9a0138c02438        3 weeks ago         391.6 MB\n<\/code><\/pre>\n<p>\u53c2\u8003\u306b\u5143\u306e\u516c\u5f0f\u30a4\u30e1\u30fc\u30b8\u3082\u8f09\u305b\u307e\u3057\u305f\u304c\u3001\u30b5\u30a4\u30ba\u304c\u7d50\u69cb\u3067\u304b\u3044\u3067\u3059\u306d\u3002<\/p>\n<h2>Docker Compose \u3067\u8d77\u52d5\u3059\u308b<\/h2>\n<p>docker-compose.yml\u3092\u8abf\u6574\u3002\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u306f23306\u306b\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>docker-compose.yml<\/p>\n<pre><code>datastore:\n  image: busybox\n  volumes:\n    - \/var\/lib\/mysql\n  container_name: mariadb-datastore\n\nmariadb:\n  image: mariadb_jp:10.1\n  environment:\n    MYSQL_ROOT_PASSWORD: mysecretpassword\n    MYSQL_USER: foo\n    MYSQL_PASSWORD: foopassword\n    MYSQL_DATABASE: foodb\n  volumes:\n    - .\/conf.d\/:\/etc\/mysql\/conf.d\n    - .\/initdb\/:\/docker-entrypoint-initdb.d\n  ports:\n    - \"23306:3306\"\n  volumes_from:\n    - datastore\n  container_name: mariadb-db\n<\/code><\/pre>\n<p>\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre><code>$ docker-compose up -d  \nCreating mariadb-datastore\nCreating mariadb-db\n<\/code><\/pre>\n<p>\u8d77\u52d5\u72b6\u614b\u306e\u78ba\u8a8d\u3002<\/p>\n<pre><code>$ docker ps -a\nCONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS                          PORTS                     NAMES\nad95de15a67a        mariadb_jp:10.1     \"docker-entrypoint.sh\"   About a minute ago   Up About a minute               0.0.0.0:23306-&gt;3306\/tcp   mariadb-db\n3515029a71b5        busybox             \"sh\"                     About a minute ago   Exited (0) About a minute ago                             mariadb-datastore\n<\/code><\/pre>\n<p>Sequel Pro \u3092\u4f7f\u3044\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u3057\u305f23306\u306b\u30e6\u30fc\u30b6\u30fcfoo\u3067foodb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u3057\u3066\u521d\u671f\u5316\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u52d5\u4f5c\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b3\u30f3\u30c6\u30ca\u3067\u306e\u63a5\u7d9a\u7528\u306b\u4f5c\u6210\u3057\u305fclient\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8abf\u6574\u3002<\/p>\n<p>client<\/p>\n<pre><code>docker run -it --link mariadb-db:mysql --rm mariadb_jp:10.1 sh -c 'exec mysql -h\"$MYSQL_PORT_3306_TCP_ADDR\" -P\"$MYSQL_PORT_3306_TCP_PORT\" -uroot -p\"$MYSQL_ENV_MYSQL_ROOT_PASSWORD\"'\n<\/code><\/pre>\n<p>\u63a5\u7d9a\u3057\u3066\u52d5\u4f5c\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre><code>$ .\/client  \nWelcome to the MariaDB monitor.  Commands end with ; or \\g.\nYour MariaDB connection id is 5\nServer version: 10.1.16-MariaDB-1~jessie mariadb.org binary distribution\n\nCopyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nMariaDB [(none)]&gt; SHOW DATABASES;\n+--------------------+\n| Database           |\n+--------------------+\n| foodb              |\n| information_schema |\n| mysql              |\n| performance_schema |\n+--------------------+\n4 rows in set (0.00 sec)\n\nMariaDB [(none)]&gt; select Host, User from mysql.user;\n+------+------+\n| Host | User |\n+------+------+\n| %    | foo  |\n| %    | root |\n+------+------+\n2 rows in set (0.00 sec)\n\nMariaDB [(none)]&gt; USE foodb;\nReading table information for completion of table and column names\nYou can turn off this feature to get a quicker startup with -A\n\nDatabase changed\nMariaDB [foodb]&gt; SHOW TABLES;\n+-----------------+\n| Tables_in_foodb |\n+-----------------+\n| users           |\n+-----------------+\n1 row in set (0.00 sec)\n\nMariaDB [foodb]&gt; SELECT * from users;\n+------+--------+\n| id   | name   |\n+------+--------+\n|    1 | first  |\n|    1 | second |\n+------+--------+\n2 rows in set (0.00 sec)\n\nMariaDB [foodb]&gt; exit\nBye\n<\/code><\/pre>\n<h2>Percona Server<\/h2>\n<p><a href=\"https:\/\/hub.docker.com\/_\/percona\/\" target=\"_blank\">OFFICIAL REPOSITORY percona<\/a><\/p>\n<p>2016\u5e748\u6708\u4e2d\u65ec\u73fe\u5728\u306e\u5bfe\u5fdc\u30d0\u30fc\u30b8\u30e7\u30f3\u3002<\/p>\n<p>5.7(5.7.13), 5.6 (5.6.32), 5.5 (5.5.51)<\/p>\n<p>MariaDB\u3068\u9055\u3063\u3066MySQL\u6e96\u62e0\u3067\u3059\u306d\u3002latest\u306f5.7\u7cfb\u3002\u4eca\u56de\u306f5.7\u7cfb\u3067\u9032\u3081\u307e\u3059\u3002<\/p>\n<h3>\u65e5\u672c\u8a9e\u5316\u3055\u308c\u305f\u30a4\u30e1\u30fc\u30b8\u306e\u4f5c\u6210<\/h3>\n<p>default locale\u3092\u8a2d\u5b9a\u3059\u308bDockerfile\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<p>Dockerfile<\/p>\n<pre><code>FROM percona:5.7\n\nMAINTAINER murave\n\nRUN apt-get update &amp;&amp; apt-get install locales -y &amp;&amp; localedef -i ja_JP -c -f UTF-8 -A \/usr\/share\/locale\/locale.alias ja_JP.UTF-8\nENV LANG ja_JP.utf8\n<\/code><\/pre>\n<p>\u65e5\u672c\u8a9e\u5316\u3055\u308c\u305f\u30a4\u30e1\u30fc\u30b8\u3001percona_jp:5.7\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<pre><code>$ docker build -t percona_jp:5.7 .\/\n<\/code><\/pre>\n<p>\u78ba\u8a8d<\/p>\n<pre><code>$ docker images\nREPOSITORY           TAG                 IMAGE ID            CREATED             SIZE\npercona_jp           5.7                 22e3746fb304        8 minutes ago       367.2 MB\npercona              5.7                 ed3fc6a159be        3 weeks ago         338.2 MB\n<\/code><\/pre>\n<p>\u3053\u3061\u3089\u3082\u53c2\u8003\u306b\u5143\u306e\u516c\u5f0f\u30a4\u30e1\u30fc\u30b8\u3082\u8f09\u305b\u307e\u3057\u305f\u3002<\/p>\n<h2>Docker Compose \u3067\u8d77\u52d5\u3059\u308b<\/h2>\n<p>docker-compose.yml\u3092\u8abf\u6574\u3002\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u306f33306\u306b\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>docker-compose.yml<\/p>\n<pre><code>datastore:\n  image: busybox\n  volumes:\n    - \/var\/lib\/mysql\n  container_name: percona-datastore\n\npercona:\n  image: percona_jp:5.7\n  environment:\n    MYSQL_ROOT_PASSWORD: mysecretpassword\n    MYSQL_USER: foo\n    MYSQL_PASSWORD: foopassword\n    MYSQL_DATABASE: foodb\n  volumes:\n    - .\/conf.d\/:\/etc\/mysql\/conf.d\n    - .\/initdb\/:\/docker-entrypoint-initdb.d\n  ports:\n    - \"33306:3306\"\n  volumes_from:\n    - datastore\n  container_name: percona-db\n<\/code><\/pre>\n<p>\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre><code>$ docker-compose up -d\nCreating percona-datastore\nCreating percona-db\n<\/code><\/pre>\n<p>\u8d77\u52d5\u72b6\u614b\u306e\u78ba\u8a8d\u3002<\/p>\n<pre><code>$ docker ps -a\nCONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                      PORTS                     NAMES\nb39630e2fd38        percona_jp:5.7      \"docker-entrypoint.sh\"   35 seconds ago      Up 33 seconds               0.0.0.0:33306-&gt;3306\/tcp   percona-db\nea4c9a0a21b5        busybox             \"sh\"                     35 seconds ago      Exited (0) 34 seconds ago                             percona-datastore\n<\/code><\/pre>\n<p>Sequel Pro \u3092\u4f7f\u3044\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u3057\u305f33306\u306b\u30e6\u30fc\u30b6\u30fcfoo\u3067foodb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u3057\u3066\u521d\u671f\u5316\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u52d5\u4f5c\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30b3\u30f3\u30c6\u30ca\u3067\u306e\u63a5\u7d9a\u7528\u306b\u4f5c\u6210\u3057\u305fclient\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8abf\u6574\u3002<\/p>\n<p>client<\/p>\n<pre><code>docker run -it --link percona-db:mysql --rm percona_jp:5.7 sh -c 'exec mysql -h\"$MYSQL_PORT_3306_TCP_ADDR\" -P\"$MYSQL_PORT_3306_TCP_PORT\" -uroot -p\"$MYSQL_ENV_MYSQL_ROOT_PASSWORD\"'\n<\/code><\/pre>\n<p>\u63a5\u7d9a\u3057\u3066\u52d5\u4f5c\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre><code>$ .\/client  \nmysql: [Warning] Using a password on the command line interface can be insecure.\nWelcome to the MySQL monitor.  Commands end with ; or \\g.\nYour MySQL connection id is 6\nServer version: 5.7.13-6 Percona Server (GPL), Release '6', Revision 'e3d58bb'\n\nCopyright (c) 2009-2016 Percona LLC and\/or its affiliates\nCopyright (c) 2000, 2016, Oracle and\/or its affiliates. All rights reserved.\n\nOracle is a registered trademark of Oracle Corporation and\/or its\naffiliates. Other names may be trademarks of their respective\nowners.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nmysql&gt; SHOW DATABASES;\n+--------------------+\n| Database           |\n+--------------------+\n| information_schema |\n| foodb              |\n| mysql              |\n| performance_schema |\n| sys                |\n+--------------------+\n5 rows in set (0.00 sec)\n\nmysql&gt; select Host, User from mysql.user;\n+------+------+\n| Host | User |\n+------+------+\n| %    | foo  |\n| %    | root |\n+------+------+\n2 rows in set (0.00 sec)\n<\/code><\/pre>\n<p>\u305b\u3063\u304b\u304f\u306ePercona Server\u306a\u306e\u3067\u30ec\u30b9\u30dd\u30f3\u30b9\u30bf\u30a4\u30e0\u5206\u5e03\u306e\u53d6\u5f97\u3092\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><a href=\"https:\/\/www.percona.com\/doc\/percona-server\/5.7\/diagnostics\/response_time_distribution.html\" target=\"_blank\">Response Time Distribution<\/a><\/p>\n<p>\u3092\u53c2\u8003\u306bPlugin\u3092\u5c0e\u5165\u3057\u3066\u6709\u52b9\u5316\u3057\u307e\u3059\u3002<\/p>\n<pre><code>mysql&gt; INSTALL PLUGIN QUERY_RESPONSE_TIME_AUDIT SONAME 'query_response_time.so';\nQuery OK, 0 rows affected (0.03 sec)\n\nmysql&gt; INSTALL PLUGIN QUERY_RESPONSE_TIME SONAME 'query_response_time.so';\nQuery OK, 0 rows affected (0.03 sec)\n\nmysql&gt; INSTALL PLUGIN QUERY_RESPONSE_TIME_READ SONAME 'query_response_time.so';\nQuery OK, 0 rows affected (0.03 sec)\n\nmysql&gt; INSTALL PLUGIN QUERY_RESPONSE_TIME_WRITE SONAME 'query_response_time.so';\nQuery OK, 0 rows affected (0.02 sec)\n\nmysql&gt; SHOW PLUGINS;\n+-----------------------------+----------+--------------------+------------------------+---------+\n| Name                        | Status   | Type               | Library                | License |\n+-----------------------------+----------+--------------------+------------------------+---------+\n                                     (\u9577\u3044\u306e\u3067\u7701\u7565\u3057\u307e\u3057\u305f)\n| QUERY_RESPONSE_TIME_AUDIT   | ACTIVE   | AUDIT              | query_response_time.so | GPL     |\n| QUERY_RESPONSE_TIME         | ACTIVE   | INFORMATION SCHEMA | query_response_time.so | GPL     |\n| QUERY_RESPONSE_TIME_READ    | ACTIVE   | INFORMATION SCHEMA | query_response_time.so | GPL     |\n| QUERY_RESPONSE_TIME_WRITE   | ACTIVE   | INFORMATION SCHEMA | query_response_time.so | GPL     |\n+-----------------------------+----------+--------------------+------------------------+---------+\n52 rows in set (0.00 sec)\n\nmysql&gt; SET GLOBAL query_response_time_stats = on;\nQuery OK, 0 rows affected (0.00 sec)\n\nmysql&gt; SELECT * from INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;\n+----------------+-------+----------------+\n| TIME           | COUNT | TOTAL          |\n+----------------+-------+----------------+\n|       0.000001 |     0 |       0.000000 |\n|       0.000010 |     0 |       0.000000 |\n|       0.000100 |     0 |       0.000000 |\n|       0.001000 |     1 |       0.000271 |\n|       0.010000 |     0 |       0.000000 |\n|       0.100000 |     0 |       0.000000 |\n|       1.000000 |     0 |       0.000000 |\n|      10.000000 |     0 |       0.000000 |\n|     100.000000 |     0 |       0.000000 |\n|    1000.000000 |     0 |       0.000000 |\n|   10000.000000 |     0 |       0.000000 |\n|  100000.000000 |     0 |       0.000000 |\n| 1000000.000000 |     0 |       0.000000 |\n| TOO LONG       |     0 | TOO LONG       |\n+----------------+-------+----------------+\n14 rows in set (0.01 sec)\n<\/code><\/pre>\n<p>\u304a\u30fc\u3002\u53d6\u308c\u305f\u53d6\u308c\u305f\u3002<\/p>\n<p>\u521d\u671f\u6295\u5165\u30c7\u30fc\u30bf\u306e\u30b5\u30f3\u30d7\u30eb\u306b\u3064\u3044\u3066second\u306eid\u30921\u306b\u3057\u3066\u3044\u308b\u3068\u3044\u3046\u6065\u305a\u304b\u3057\u3044\u72b6\u6cc1\u306b\u6c17\u3065\u3044\u305f\u306e\u3067Sequel Pro\u3067\u7de8\u96c6\u3001\u3064\u3044\u3067\u306b3:third\u3092\u8ffd\u52a0\u3057\u3066\u304b\u3089\u518d\u5ea6\u30ec\u30b9\u30dd\u30f3\u30b9\u30bf\u30a4\u30e0\u5206\u5e03\u3092\u53d6\u5f97\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre><code>mysql&gt; SELECT * from INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;\n+----------------+-------+----------------+\n| TIME           | COUNT | TOTAL          |\n+----------------+-------+----------------+\n|       0.000001 |     0 |       0.000000 |\n|       0.000010 |     8 |       0.000057 |\n|       0.000100 |     3 |       0.000173 |\n|       0.001000 |     9 |       0.001866 |\n|       0.010000 |     0 |       0.000000 |\n|       0.100000 |     2 |       0.058591 |\n|       1.000000 |     0 |       0.000000 |\n|      10.000000 |     0 |       0.000000 |\n|     100.000000 |     0 |       0.000000 |\n|    1000.000000 |     0 |       0.000000 |\n|   10000.000000 |     0 |       0.000000 |\n|  100000.000000 |     0 |       0.000000 |\n| 1000000.000000 |     0 |       0.000000 |\n| TOO LONG       |     0 | TOO LONG       |\n+----------------+-------+----------------+\n14 rows in set (0.00 sec)\n<\/code><\/pre>\n<p>\u767a\u884c\u3055\u308c\u305fSequel Pro\u304b\u3089\u767a\u884c\u3055\u308c\u305f\u30af\u30a8\u30ea\u6587\u5897\u3048\u307e\u3057\u305f\u3002\u30b9\u30ed\u30fc\u30af\u30a8\u30ea\u306f\u306a\u3044\u3067\u3059\u306d(\u3042\u305f\u308a\u307e\u3048)\u3002<\/p>\n<p>\u6c17\u8efd\u306b\u8a66\u305b\u3066\u826f\u3044\u3067\u3059\u306d\u3002<br \/>\n\u4ee5\u4e0a\u3001\u300cDocker\u516c\u5f0f\u30a4\u30e1\u30fc\u30b8\u3067\u958b\u767a\u7528RDB\u3092\u30b2\u30c3\u30c8\u3060\u305c\u300d\u3067\u3057\u305f\u3002<\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F4576&amp;t=Docker%E5%85%AC%E5%BC%8F%E3%82%A4%E3%83%A1%E3%83%BC%E3%82%B8%E3%81%A7%E9%96%8B%E7%99%BA%E7%94%A8RDB%E3%82%92%E3%82%B2%E3%83%83%E3%83%88%E3%81%A0%E3%81%9C%28MariaDB%E3%80%81Percona%20Server%E7%B7%A8%29&amp;s=100&amp;p[url]=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F4576&amp;p[images][0]=http%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-content%2Fuploads%2F2016%2F08%2F83b0d04e2b872cb4d8b55a9cb9caa92e-400x241.jpg&amp;p[title]=Docker%E5%85%AC%E5%BC%8F%E3%82%A4%E3%83%A1%E3%83%BC%E3%82%B8%E3%81%A7%E9%96%8B%E7%99%BA%E7%94%A8RDB%E3%82%92%E3%82%B2%E3%83%83%E3%83%88%E3%81%A0%E3%81%9C%28MariaDB%E3%80%81Percona%20Server%E7%B7%A8%29\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"http:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F4576&amp;text=Docker%E5%85%AC%E5%BC%8F%E3%82%A4%E3%83%A1%E3%83%BC%E3%82%B8%E3%81%A7%E9%96%8B%E7%99%BA%E7%94%A8RDB%E3%82%92%E3%82%B2%E3%83%83%E3%83%88%E3%81%A0%E3%81%9C%28MariaDB%E3%80%81Percona%20Server%E7%B7%A8%29\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&amp;url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F4576&amp;title=Docker%E5%85%AC%E5%BC%8F%E3%82%A4%E3%83%A1%E3%83%BC%E3%82%B8%E3%81%A7%E9%96%8B%E7%99%BA%E7%94%A8RDB%E3%82%92%E3%82%B2%E3%83%83%E3%83%88%E3%81%A0%E3%81%9C%28MariaDB%E3%80%81Percona%20Server%E7%B7%A8%29\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-tumblr nolightbox\" data-provider=\"tumblr\" target=\"_blank\" rel=\"nofollow\" title=\"Share on tumblr\" href=\"https:\/\/tumblr.com\/share?s=&amp;v=3&amp;t=Docker%E5%85%AC%E5%BC%8F%E3%82%A4%E3%83%A1%E3%83%BC%E3%82%B8%E3%81%A7%E9%96%8B%E7%99%BA%E7%94%A8RDB%E3%82%92%E3%82%B2%E3%83%83%E3%83%88%E3%81%A0%E3%81%9C%28MariaDB%E3%80%81Percona%20Server%E7%B7%A8%29&amp;u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F4576\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"tumblr\" title=\"Share on tumblr\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/tumblr.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=Docker%E5%85%AC%E5%BC%8F%E3%82%A4%E3%83%A1%E3%83%BC%E3%82%B8%E3%81%A7%E9%96%8B%E7%99%BA%E7%94%A8RDB%E3%82%92%E3%82%B2%E3%83%83%E3%83%88%E3%81%A0%E3%81%9C%28MariaDB%E3%80%81Percona%20Server%E7%B7%A8%29&amp;body=%E3%82%B7%E3%82%A7%E3%82%A2%E3%81%99%E3%82%8B%EF%BC%9A:%20https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F4576\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>\u307e\u3048\u304c\u304d Docker\u516c\u5f0f\u30a4\u30e1\u30fc\u30b8\u3067\u958b\u767a\u7528RDB\u3092\u30b2\u30c3\u30c8\u3060\u305c(PostgreSQL\u7de8) Docker\u516c\u5f0f\u30a4\u30e1\u30fc\u30b8\u3067\u958b\u767a\u7528RDB\u3092\u30b2\u30c3\u30c8\u3060\u305c(MySQL\u7de8) \u306b\u7d9a\u304d\u4e88\u5b9a\u3069\u304a\u308aMariaDB\u7de8\u3092\u304a\u9001\u308a\u3057\u307e\u3059\u3002\u4e00\u8a00\u3067\u6e08\u3080\u306e\u3067\u7d50 [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48,61],"tags":[153,137,157,138,158],"class_list":["post-4576","post","type-post","status-publish","format-standard","hentry","category-mac","category-mysql","tag-docker","tag-mac","tag-mariadb","tag-mysql","tag-percona"],"_links":{"self":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/4576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/comments?post=4576"}],"version-history":[{"count":3,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/4576\/revisions"}],"predecessor-version":[{"id":4580,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/4576\/revisions\/4580"}],"wp:attachment":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/media?parent=4576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/categories?post=4576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/tags?post=4576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}