diff --git a/mysql/data/.gitignore b/mysql/data/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/mysql/data/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/mysql/etc/conf.d/docker.cnf b/mysql/etc/conf.d/docker.cnf new file mode 100644 index 0000000..bd76e00 --- /dev/null +++ b/mysql/etc/conf.d/docker.cnf @@ -0,0 +1,10 @@ +[mysqld] +character-set-server=utf8mb4 +skip-host-cache +skip-name-resolve + +[client] +default-character-set=utf8mb4 + +[mysql] +default-character-set=utf8mb4 diff --git a/mysql/etc/conf.d/mysql.cnf b/mysql/etc/conf.d/mysql.cnf new file mode 100644 index 0000000..51fbccb --- /dev/null +++ b/mysql/etc/conf.d/mysql.cnf @@ -0,0 +1,29 @@ +# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# +# The MySQL Client configuration file. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +[mysql] diff --git a/mysql/etc/my.cnf b/mysql/etc/my.cnf new file mode 100644 index 0000000..e9f2eda --- /dev/null +++ b/mysql/etc/my.cnf @@ -0,0 +1,31 @@ +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# +# The MySQL Server configuration file. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +[mysqld] +pid-file = /var/run/mysqld/mysqld.pid +socket = /var/run/mysqld/mysqld.sock +datadir = /var/lib/mysql +secure-file-priv= NULL +# Disabling symbolic-links is recommended to prevent assorted security risks +symbolic-links=0 + +# Custom config should go here +!includedir /etc/mysql/conf.d/ diff --git a/mysql/etc/my.cnf.fallback b/mysql/etc/my.cnf.fallback new file mode 100644 index 0000000..a9da3ba --- /dev/null +++ b/mysql/etc/my.cnf.fallback @@ -0,0 +1,32 @@ +# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2.0, +# as published by the Free Software Foundation. +# +# This program is also distributed with certain software (including +# but not limited to OpenSSL) that is licensed under separate terms, +# as designated in a particular file or component or in included license +# documentation. The authors of MySQL hereby grant you an additional +# permission to link the program and your derivative works with the +# separately licensed software that they have included with MySQL. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License, version 2.0, for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# +# The MySQL Community Server configuration file. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +# * IMPORTANT: Additional settings that can override those from this file! +# The files must end with '.cnf', otherwise they'll be ignored. +# +!includedir /etc/mysql/conf.d/ diff --git a/mysql/run.sh b/mysql/run.sh new file mode 100755 index 0000000..7dff879 --- /dev/null +++ b/mysql/run.sh @@ -0,0 +1,5 @@ +#!/bin/sh +docker ps +docker stop mysql +docker rm mysql +docker run --name mysql -p 3306:3306 -v $PWD/etc:/etc/mysql -v $PWD/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=73937393 -d mysql:latest