Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qg-dockerfiles
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qg-dockerfiles
Commits
eb66ea43
Commit
eb66ea43
authored
Jan 30, 2018
by
daidekun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改db
parent
28e49c46
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
171 additions
and
4 deletions
+171
-4
Dockerfile
baseimg/tools/db/Dockerfile
+2
-4
my.cnf
baseimg/tools/db/my.cnf
+30
-0
mysqld_charset.cnf
baseimg/tools/db/mysqld_charset.cnf
+7
-0
Dockerfile
baseimg/tools/db_bak/Dockerfile
+23
-0
init_db_data.sh
baseimg/tools/db_bak/init_db_data.sh
+18
-0
mysqld.cnf
baseimg/tools/db_bak/mysqld.cnf
+0
-0
0-init_user_and_db.sql
baseimg/tools/db_bak/sql_to_run/0-init_user_and_db.sql
+91
-0
No files found.
baseimg/tools/db/Dockerfile
View file @
eb66ea43
# VERSION 1.0
FROM
mysql:5.6.37
MAINTAINER
kalvin <dekun.dai@quantgroup.cn>
#定义工作目录
ENV
WORK_PATH /home/quant_group/mysql
...
...
@@ -14,7 +11,8 @@ WORKDIR $WORK_PATH
RUN
mkdir
-p
sql_to_run
COPY
mysqld.cnf /etc/mysql/mysql.conf.d/mysqld.cnf
COPY
my.cnf /etc/mysql/mysql.conf.d/mysqld.cnf
COPY
mysqld_charset.cnf /etc/mysql/conf.d/mysqld_charset.cnf
COPY
./sql_to_run/0-init_user_and_db.sql ./sql_to_run/
#把要执行的shell文件放到/docker-entrypoint-initdb.d/目录下,容器会自动执行这个shell
COPY
./init_db_data.sh $AUTO_RUN_DIR/
...
...
baseimg/tools/db/my.cnf
0 → 100644
View file @
eb66ea43
# Copyright (c) 2014, 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 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
log-error = /var/log/mysql/error.log
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
max_connections = 1000
\ No newline at end of file
baseimg/tools/db/mysqld_charset.cnf
0 → 100644
View file @
eb66ea43
[mysqld]
character_set_server=utf8
character_set_filesystem=utf8
collation-server=utf8_general_ci
init-connect='SET NAMES utf8'
init_connect='SET collation_connection = utf8_general_ci'
skip-character-set-client-handshake
\ No newline at end of file
baseimg/tools/db_bak/Dockerfile
0 → 100644
View file @
eb66ea43
# VERSION 1.0
FROM
mysql:5.6.37
MAINTAINER
kalvin <dekun.dai@quantgroup.cn>
#定义工作目录
ENV
WORK_PATH /home/quant_group/mysql
#定义会被容器自动执行的目录
ENV
AUTO_RUN_DIR /docker-entrypoint-initdb.d
WORKDIR
$WORK_PATH
RUN
mkdir
-p
sql_to_run
COPY
mysqld.cnf /etc/mysql/mysql.conf.d/mysqld.cnf
COPY
./sql_to_run/0-init_user_and_db.sql ./sql_to_run/
#把要执行的shell文件放到/docker-entrypoint-initdb.d/目录下,容器会自动执行这个shell
COPY
./init_db_data.sh $AUTO_RUN_DIR/
#给执行文件增加可执行权限
RUN
chmod
a+x
$AUTO_RUN_DIR
/init_db_data.sh
\ No newline at end of file
baseimg/tools/db_bak/init_db_data.sh
0 → 100644
View file @
eb66ea43
# -------------------------------------------------------------------------------
# Filename: init_db_data.sh
# Revision: 1.0
# Date: 2017/08
# Author: dekun.dai
# Description: 执行目录下所有数据库脚本
# -------------------------------------------------------------------------------
sql_file_folder
=
$WORK_PATH
/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
baseimg/tools/db/mysqld.cnf
→
baseimg/tools/db
_bak
/mysqld.cnf
View file @
eb66ea43
File moved
baseimg/tools/db_bak/sql_to_run/0-init_user_and_db.sql
0 → 100644
View file @
eb66ea43
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
;
CREATE
DATABASE
user_credit
;
GRANT
ALL
PRIVILEGES
ON
*
.
*
TO
'qa'
@
'%'
IDENTIFIED
BY
'qatest'
;
flush
privileges
;
CREATE
DATABASE
silk_road
;
GRANT
ALL
PRIVILEGES
ON
*
.
*
TO
'qa'
@
'%'
IDENTIFIED
BY
'qatest'
;
flush
privileges
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment