Skip to content

Instantly share code, notes, and snippets.

@darth30joker
Created July 22, 2014 02:53
Show Gist options
  • Save darth30joker/f4855b6ff490cb36455b to your computer and use it in GitHub Desktop.
Save darth30joker/f4855b6ff490cb36455b to your computer and use it in GitHub Desktop.
[mysqld]
bind-address=0.0.0.0
console=1
general_log=1
general_log_file=/dev/stdout
log_error=/dev/stderr
collation-server=utf8_unicode_ci
character-set-server=utf8
#!/bin/sh
chown -R mysql:mysql /var/lib/mysql
mysql_install_db --user mysql > /dev/null
mysqld_safe --user mysql &
sleep 5s
mysql -v < /root/mariadb.sql
sleep 5s
ps -wef | grep mysql | grep -v grep | awk '{print $2}' | xargs kill -9
mysqld_safe --user mysql
# application container for MySQL
# VERSION 2014-07-14
FROM centos:latest
MAINTAINER David Xie "david.scriptfan@gmail.com"
ADD mariadb.repo /etc/yum.repos.d/mariadb.repo
ADD mariadb.sql /root/mariadb.sql
ADD server.cnf /etc/my.cnf.d/server.cnf
ADD mariadb.sh /root/mariadb.sh
RUN yum install -y hostname MariaDB-server
RUN yum clean all
RUN chmod +x /root/mariadb.sh
EXPOSE 3306
CMD ["/root/mariadb.sh"]
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
USE mysql;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
UPDATE user SET password=PASSWORD("root") WHERE user='root';
FLUSH PRIVILEGES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment