add uat sql server

master
Yik Teng Hie 5 years ago
parent d5c90d34b4
commit f08e3f4349

@ -0,0 +1,43 @@
# Setup docker for mySql
1. Start docker
```
$ docker-composer up -d
```
2. to enter CLI
```
$ docker exec -it razer-sql_db_1 bash
```
3. mysql
```
$ mysql -p
// password : root
mysql> show databases;
mysql> use db1;
mysql> create database test2;
// dump schema
$ mysqldump -p -u [user] db_name > backup-file.sql
// import schema
$ mysql -p
mysql> create database test2;
mysql> exit
$ mysql -p -u [user] [database] < backup-file.sql
```
4. Alternatively, import schema into sql db. Using GUI tool like [HeidiSQL](https://www.heidisql.com/) to simplify task
5. Stop docker
```
$ docker-compose down
```

@ -0,0 +1,22 @@
# Use root/example as user/password credentials
version: '3.1'
services:
db:
image: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: root
volumes:
- ./persistent_data:/var/lib/mysql
- ./etc/conf.d:/etc/mysql/conf.d
#adminer:
# image: adminer
# restart: always
# ports:
# - 8080:8080

@ -0,0 +1,2 @@
[mysqld]
innodb_buffer_pool_size = 2G

@ -0,0 +1,13 @@
# Persistent storage
* Sql db data store here to avoid data loss if container shutdown
```yml
services:
db:
image: mysql
...
volumes:
- ./persistent_data:/var/lib/mysql
```
Loading…
Cancel
Save