Commit 8013d274 authored by daidekun's avatar daidekun

remove

parent 3f4d5ded
FROM mysql:5.6.37
MAINTAINER kalvin "dekun.dai@quantgroup.cn"
# #替换源
WORKDIR /etc/apt/
RUN mv sources.list /tmp
RUN echo deb http://mirrors.163.com/debian/ stretch main non-free contrib >> sources.list \
&& echo deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib >> sources.list \
&& echo deb http://mirrors.163.com/debian/ stretch-backports main non-free contrib >> sources.list \
&& echo deb-src http://mirrors.163.com/debian/ stretch main non-free contrib >> sources.list \
&& echo deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib >> sources.list \
&& echo deb-src http://mirrors.163.com/debian/ stretch-backports main non-free contrib >> sources.list \
&& echo deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib >> sources.list \
&& echo deb-src http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib >> sources.list
#安装必要工具
RUN apt-get update \
&& apt-get install -y vim \
&& apt-get install -y telnet \
&& apt-get install -y openssh-server \
&& /etc/init.d/ssh start
WORKDIR /home/quant_group/mysql
RUN mkdir sql_to_run
COPY ./sql_to_run/* ./sql_to_run
COPY docker-entrypoint.sh .
COPY db_execute_sql.sh .
RUN chmod +x ./docker-entrypoint.sh
CMD ["./docker-entrypoint.sh"]
\ No newline at end of file
# -------------------------------------------------------------------------------
# Filename: db_execute_sql.sh
# Revision: 1.0
# Date: 2017/08
# Author: dekun.dai
# Description: 执行目录下所有数据库脚本
# -------------------------------------------------------------------------------
sql_file_folder=./sql_to_run
echo "cd $sql_file_folder"
cd $sql_file_folder
for entry in ./*
do
echo "run sql file: $entry"
mysql -uroot -pQuantgroup2017 < $entry
done
\ No newline at end of file
#!/bin/sh
public_ip="www.q-gp.com"
sh /etc/init.d/mysql restart
sh ./db_execute_sql.sh
\ No newline at end of file
CREATE DATABASE xyqb;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
CREATE DATABASE xyqb_app;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
CREATE DATABASE payment_center;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
CREATE DATABASE risk_control;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
CREATE DATABASE dujiangyan;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
CREATE DATABASE mall;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
CREATE DATABASE qinqiong;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
CREATE DATABASE cash_loan_flow;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
CREATE DATABASE quartz;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
CREATE DATABASE contract;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
CREATE DATABASE fund_manage;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
CREATE DATABASE financial_system;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
CREATE DATABASE gyxd;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
CREATE DATABASE offline;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
CREATE DATABASE redpacket;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
CREATE DATABASE spider_center;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
CREATE DATABASE xyqb_user;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
CREATE DATABASE merchant;
GRANT ALL PRIVILEGES ON *.* TO 'qa'@'%' IDENTIFIED BY 'qatest';
flush privileges;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment