티스토리 뷰
(base) PS C:\Users\AIA\MsaProject> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ad446d26f865 fastapiserver-api "uvicorn app.main:ap…" 7 days ago Up About an hour 0.0.0.0:8000->8000/tcp api
2b8685805bfe fastapiserver-db "docker-entrypoint.s…" 7 days ago Up 3 hours 0.0.0.0:3306->3306/tcp, 33060/tcp mydb
(base) PS C:\Users\AIA\MsaProject> docker exec -it 2b8685805bfe bash
bash-4.2# mysql -u root -p
mysql: [Warning] World-writable config file '/etc/mysql/conf.d/my.cnf' is ignored.
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 115
Server version: 5.7.40-log MySQL Community Server (GPL)
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use mydb;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+----------------+
| Tables_in_mydb |
+----------------+
| articles |
| users |
+----------------+
2 rows in set (0.00 sec)
mysql> alter table users modify token varchar(256);
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> desc users;
+-----------+--------------+------+-----+-------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+-------------------+-----------------------------+
| created | timestamp | NO | | CURRENT_TIMESTAMP | |
| modified | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
| userid | varchar(30) | NO | PRI | NULL | |
| email | varchar(50) | NO | UNI | NULL | |
| password | varchar(100) | NO | | NULL | |
| username | varchar(20) | NO | | NULL | |
| phone | varchar(20) | YES | | NULL | |
| birth | varchar(20) | YES | | NULL | |
| address | varchar(100) | YES | | NULL | |
| job | varchar(20) | YES | | NULL | |
| interests | varchar(100) | YES | | NULL | |
| token | varchar(256) | YES | | NULL | |
+-----------+--------------+------+-----+-------------------+-----------------------------+
12 rows in set (0.00 sec)
이후 반드시 도커를 재시작해야 적용된다.
재시작 후 연결된 파이참에 가서 속성 변경까지 확인한다.
MySQL 테이블 속성 변경 참조 블로그
https://juyoung-1008.tistory.com/17
'7. 클라우드' 카테고리의 다른 글
AWS 네임서버를 이용하는 경우 (0) | 2023.02.22 |
---|---|
Pulumi 에 기반한 AWS 람다 서버리스 구축 (0) | 2023.01.27 |
네이버 클라우드 1년무료 서버 구축하기 (0) | 2023.01.06 |
오라클 클라우드 계정 바로가기 (0) | 2022.12.02 |
처음 입문시 오라클 클라우드 선택한 이유(feat.요금폭탄) (0) | 2022.11.30 |
- Total
- Today
- Yesterday
- Django
- SpringBoot
- springMVC
- JUnit
- JPA
- FLASK
- docker
- React
- jQuery
- AWS
- COLAB
- KAFKA
- Eclipse
- nodejs
- terms
- Algorithm
- maven
- Mongo
- Git
- vscode
- mariadb
- ERD
- Java
- SQLAlchemy
- database
- intellij
- Python
- Oracle
- Mlearn
- tensorflow
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |