---
# System prepended metadata

title: 專案環境

---

# 專案環境
## docker
### mysql
1. 
    + ubuntu
      + sudo docker run --name some-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=[YOU_PASSWORD] -d mysql:latest
    + windows
      + docker run --name some-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=[YOU_PASSWORD] -d mysql:latest
2. sudo docker exec -it some-mysql bash
3. 登入mysql 和 建table(從編輯區複製)
mysql -p
create database db_test;
create user 'test'@'%' identified by 'test';
grant all on db_test.* to 'test'@'%'; 
 
```sql
create database db_test;
create user 'test'@'%' identified by 'test';
grant all on db_test.* to 'test'@'%';
```
<!-- 

MYSQL_ROOT_PASSWORD=**[YOU_PASSWORD]**
[YOU_PASSWORD] 填mysql root的密碼
開啟docker terminal
輸入 mysql -p
輸入以下指令，來創建資料庫、使用者、開啟權限。
```sql
create database db_test;
create user 'test'@'%' identified by 'test';
grant all on db_test.* to 'test'@'%';
``` -->

sudo docker run --name some-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=test -d mysql:latest

## 執行spring
```
./mvnw spring-boot:run
```