---
# System prepended metadata

title: AWS cloudFront & RDS

---

# AWS cloudFront & RDS

## cloudFront
![](https://i.imgur.com/aaHl348.png)
![](https://i.imgur.com/o2IWlRY.png)
![](https://i.imgur.com/1vPRitq.png)
![](https://i.imgur.com/H4Zjn3V.png)

https+分佈網域名稱/資料夾名稱/圖片名
https://doumq0p9cu8fw.cloudfront.net/pictures/DSC_0312.JPG

## RDS

![](https://i.imgur.com/d6dHGxk.png)
![](https://i.imgur.com/yL8Wvqu.png)
![](https://i.imgur.com/elzJcbL.png)
![](https://i.imgur.com/9rJVVcu.png)
![](https://i.imgur.com/ilLweFw.png)
![](https://i.imgur.com/JrLAfbJ.png)
資料庫固定3306
![](https://i.imgur.com/YaPaSHa.png)
![](https://i.imgur.com/EMQ2YRU.png)
![](https://i.imgur.com/n03q054.png)

------
本地端連結AWS RDS雲端資料庫
![](https://i.imgur.com/bX9z07x.png)

進入本地端mysql bin所在的資料夾路徑-執行
```mysql -u admin -h member2.c8ufl2wyb9mg.us-east-1.rds.amazonaws.com -p```
admin是主要使用者名稱若沒更改預設就為admin

```
CREATE TABLE user_list (
user_id INT AUTO_INCREMENT PRIMARY KEY,
user_name VARCHAR(20) NOT NULL,
user_account VARCHAR(16) NOT NULL,
user_password VARCHAR(16) NOT NULL,
user_email VARCHAR(256) NOT NULL
);
````
member.c8ufl2wyb9mg.us-east-1.rds.amazonaws.com是RDS的endpoint&port
![](https://i.imgur.com/74Ts43S.png)


![](https://i.imgur.com/bld3Mhs.png)
![](https://i.imgur.com/WVhaYyn.png)
![](https://i.imgur.com/teHRMhO.png)

-----------------------
換本地端開發
1. 創建signature_main table
```
create table signature_main (
signature_id int primary key auto_increment,
initiator int,
map varchar(300),
subject varchar(255),
start_time varchar(20),
dead_time varchar(20),
mark_user varchar(20),
final_state varchar(20)
);
```
2. 填值到signature_main table
```
INSERT INTO signature_main (initiator, map, subject, start_time, dead_time,final_state) VALUES (1, "1,2,5,7","簽呈測試1","2023/01/25","2023/01/30","");
```

3. 創建signature_participate table
```
create table signature_participate(
signature_id int,
user_id int
);
```

4. 填值到signature_participate table
```
INSERT INTO signature_participate (signature_id, user_id) VALUES (1,1);
```

5. 創建signature_track table
```
create table signature_track (
signature_track_id int primary key auto_increment,
signature_id int,
executor int,
method varchar(10),
next_person int,
text varchar(1000),
file varchar(100),
processing_time varchar(20)
);
```

6. 填值到signature_track table
```
INSERT INTO signature_track (signature_id, executor, method, next_person, text,file,processing_time) VALUES (1, 1,"create",2,"test1test1test1","","2023/09/01";
```

7. 創建user_friendship table
```
create table user_friendship (
user_id int ,
friend_id int
);
```

8. 填值到user_friendship table
```
INSERT INTO user_friendship (user_id, friend_id) VALUES (1,2);
```

9. 創建user_private table
```
create table user_private (
user_id int primary key auto_increment,
user_name varchar(20),
user_account varchar(16),
user_password varchar(16),
user_email varchar(256)
);
```

10. 填值到user_private table
```
INSERT INTO user_private (user_name, user_account, user_password, user_email) VALUES ("阿1","111","111","111");
```


![](https://i.imgur.com/k9NSj8y.png)



---
# esignature2

1. 創建signature_main table
```
create table signature_main (
signature_id int primary key auto_increment,
subject varchar(50),
start_time varchar(20),
dead_time varchar(20),
text varchar(255),
file varchar(255),
final_state varchar(20),
processing_time varchar(20)
);
```

2. 填值到signature_main table
```
INSERT INTO signature_main (subject,start_time, dead_time,text,file,final_state,processing_time) VALUES ("簽呈測試1", "2023/01/25","2023/01/30","簽呈測試1內文內文內文","一串編碼後的url","","");
```

3. 創建signature_participate table
```
create table signature_participate(
sequence_num int primary key auto_increment,
signature_id int,
user_id int,
confirm varchar(2)
);
```

4. 填值到signature_participate table
```
INSERT INTO signature_participate (signature_id, user_id,confirm) VALUES (1,1,"T");
```


## new
1. 創建signature_main table
```
create table signature_main (
signature_id int primary key auto_increment,
signature_type int,
initiator int,
subject varchar(50),
map varchar(50),
start_time varchar(20),
dead_time varchar(20),
text varchar(255),
file varchar(255),
final_state varchar(20),
processing_time varchar(20)
);
```

2. 填值到signature_main table
```
INSERT INTO signature_main (signature_type,initiator,subject,map,start_time, dead_time,text,file,final_state,processing_time) VALUES ("",1,"簽呈測試1","1,2,5,7", "2023/01/25","2023/01/30","簽呈測試1內文內文內文","一串編碼後的url","","");
```

3. 創建signature_turn_person table
```
create table signature_turn_person (
signature_id int,
turn_person int
);
```

4. 填值到signature_turn_person table
```
INSERT INTO signature_turn_person (signature_id,
turn_person) VALUES (1,2);
```

#### 刪除特定資料
```
 delete from signature_main where signature_id=2; 
```

5. 創建user_department table
```
create table user_department (department_id INT,
department_name VARCHAR(20),department_head VARCHAR(20));
```

6. 填值到user_department table
```
INSERT INTO user_department (department_id,
department_name,department_head) VALUES (0,"董事長室","阿1");
```

7. 創建signature_grade table
```
create table signature_grade (signature_class varchar(10),signature_type INT);
```


8. 填值到signature_grade table
```
INSERT INTO signature_grade (signature_class,signature_type) VALUES ("極重要",0);
```

9. 創建user_private table
```
create table user_private (
user_id int primary key auto_increment,
user_name varchar(20),
user_account varchar(16),
user_password varchar(16),
user_email varchar(256),
user_company varchar(10),
user_grade int,
department_id int,
parent_id int
);
```

10. 填值到user_private table
```
INSERT INTO user_private (user_name, user_account, user_password, user_email,user_company,user_grade,department_id,parent_id) VALUES ("阿1","111","111","111","A",0,0,0);
```

11. 創建signature_participate table
```
create table signature_participate(
sequence_num int primary key auto_increment,
signature_id int,
user_id int,
confirm varchar(10)
);
```

12. 填值到signature_participate table
```
INSERT INTO signature_participate (signature_id, user_id,confirm) VALUES (1,1,"pass");
```





## more new

## new
1. 創建signature_main table
```
create table signature_main (
signature_id int primary key auto_increment,
signature_type int,
initiator int,
subject varchar(50),
start_time varchar(20),
text varchar(255),
file varchar(255),
final_state varchar(20),
processing_time varchar(20)
);
```

2. 填值到signature_main table
```
INSERT INTO signature_main (signature_type,initiator,subject,map,start_time, dead_time,text,file,final_state,processing_time) VALUES ("",1,"簽呈測試1","1,2,5,7", "2023/01/25","2023/01/30","簽呈測試1內文內文內文","一串編碼後的url","","");
```

3. 創建signature_turn_person table
```
create table signature_turn_person (
signature_id int,
turn_person int
);
```

4. 填值到signature_turn_person table
```
INSERT INTO signature_turn_person (signature_id,
turn_person) VALUES (1,2);
```

#### 刪除特定資料
```
 delete from signature_main where signature_id=2; 
```

5. 創建user_department table
```
create table user_department (department_id INT,
department_name VARCHAR(20),department_head VARCHAR(20));
```

6. 填值到user_department table
```
INSERT INTO user_department (department_id,
department_name,department_head) VALUES (0,"董事長室","阿1");
```

7. 創建signature_grade table
```
create table signature_grade (signature_class varchar(10),signature_type INT);
```


8. 填值到signature_grade table
```
INSERT INTO signature_grade (signature_class,signature_type) VALUES ("極重要",0);
```

9. 創建user_private table
```
create table user_private (
user_id int primary key auto_increment,
user_name varchar(20),
user_account varchar(16),
user_password varchar(16),
user_email varchar(256),
user_company varchar(10),
user_grade int,
department_id int,
parent_id int
);
```

10. 填值到user_private table
```
INSERT INTO user_private (user_name, user_account, user_password,user_email,user_company,user_grade,department_id,parent_id) VALUES ("阿1","111","111","111","A",0,0,0);
```

11. 創建signature_participate table
```
create table signature_participate(
sequence_num int primary key auto_increment,
signature_id int,
user_id int,
confirm varchar(10)
);
```

12. 填值到signature_participate table
```
INSERT INTO signature_participate (signature_id, user_id,confirm) VALUES (1,1,"pass");
```






### version3
## more new

## new
1. 創建signature_main table
```
create table signature_main (
signature_id int primary key auto_increment,
initiator int,
subject varchar(50),
final_state varchar(20),
start_time varchar(20),
end_time varchar(20)
);
```

2. 填值到signature_main table
```
INSERT INTO signature_main (initiator,subject,final_state) VALUES (1,"簽呈測試1","");
```



3. 創建signature_version_content table
```
create table signature_version_content (
version_id int primary key auto_increment,
signature_id int,
text varchar(255),
file varchar(255),
get_response varchar(255)
);
```


4. 填值到signature_version_content table
```
INSERT INTO signature_version_content (text,file,get_response) VALUES ("簽呈測試1內文","簽呈測試1檔案","");
```



5. 創建signature_participate table
```
create table signature_participate(
sequence_num int primary key auto_increment,
signature_id int,
user_id int,
confirm varchar(10),
processing_time varchar(20)
);
```

6. 填值到signature_participate table
```
INSERT INTO signature_participate (signature_id, user_id,confirm,processing_time) VALUES (1,1,"pass","2023-02-15");
```


7. 創建signature_turn_person table
```
    create table signature_turn_person (
    signature_id int,
    turn_person int
    );
```

8. 填值到signature_turn_person table
```
INSERT INTO signature_turn_person (signature_id,
turn_person) VALUES (1,2);
```

#### 刪除特定資料
```
 delete from signature_main where signature_id=2; 
```


9. 創建user_private table
```
create table user_private (
user_id int primary key auto_increment,
user_name varchar(20),
user_account varchar(16),
user_password varchar(16),
user_email varchar(256),
company_id int,
host_judge int,
department_id int
);
```

10. 填值到user_private table
```
INSERT INTO user_private (user_name, user_account, user_password,user_email,company_id,host_judge,department_id) VALUES ("阿一","111","111","111","1",1,1);
```



11. 創建 company_department table
```
create table company_department(department_id int primary key auto_increment,department_name varchar(10),company_id int);
```


12. 填值到 company_department table
```
INSERT INTO company_department (department_name,company_id) VALUES ("品管部",1);
```


13. 創建company_main table
```
create table company_main(company_id INT primary key auto_increment,company_name VARCHAR(20));
```

14. 創建company_manager table
```
create table company_manager (company_id int,manager_id INT);
```

