Created
July 22, 2014 02:53
-
-
Save darth30joker/f4855b6ff490cb36455b to your computer and use it in GitHub Desktop.
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
[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 |
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
#!/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 |
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
# 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"] |
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
[mariadb] | |
name = MariaDB | |
baseurl = http://yum.mariadb.org/10.0/centos6-amd64 | |
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB | |
gpgcheck=1 |
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
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