This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#클러스터 상태 확인 | |
http://192.168.219.141:9200/_cluster/stats | |
#노크 상태 확인 | |
http://192.168.219.138:9200/_nodes/process?pretty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#부팅모드 변경 | |
1.영구 변경 | |
systemctl set-default multi-user.target(CLI) | |
systemctl set-default graphical.target(GUI) | |
2.일시 변경 | |
systemctl isolate multi-user.target(CLI) | |
systemctl isolate graphical.target(GUI) | |
#port 방화벽 설정 | |
1.port 상태 확인 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
테이블 구조 복사 | |
CREATE TABLE IF NOT EXISTS 복사 테이블 LIKE 원본 테이블; | |
IF NOT EXISTS를 통해 이미 테이블이 존재하면 복사하지 않는다. | |
테이블 구조와 데이터 복사 | |
CREATE TABLE IF NOT EXISTS 복사테이블 SELECT * FROM 원본 테이블; | |
기본키와 인덱스,AUTO_INCREMENT는 제외하고 복사한다 | |
테이블 데이터 복사 | |
INSERT INTO 복사테이블 SELECT * FROM 원본테이블 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<details> | |
<summary>상세 내용 확인</summary> | |
<div markdown="1"> | |
div 에 markdown attribute 를 1 로 | |
하는 이유는 div 안에서 | |
markdown 을 사용하기 위해서 입니다. | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! [rejected] master -> master (non-fast-forward) | |
error: failed to push some refs to 'https://github.com/ankiyong/day_car.git' | |
이런 오류는 로컬 디렉토리와 git의 repo의 상태가 맞지 않아서 발생하는 것이다 | |
pull을 진행하고 다시 push를 진행해보자 | |
그러면 다시 | |
fatal: invalid refspec 'https://github.com/ankiyong/day_car.git' | |
이런 오류가 발생할 수 있는데 그럴땐 | |
git pull origin master --allow-unrelated-histories | |
이렇게 pull을 진행해 주면 된다 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh 접속 | |
ssh -i ".pem" ubuntu@public ip | |
로컬에서 aws서버로 파일 전송 | |
#파일 전송시 | |
scp -i [pem file] [upload file] [user id]@[ec2 public IP]:~/[transfer address] | |
#예시 | |
scp -i Desktop/amazon/juhyung.pem Desktop/pant.py ubuntu@~~~~:~/ | |
#폴더 전송시 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
E: Unable to locate package python3-pip 오류 해결 | |
sudo add-apt-repository universe | |
sudo apt-get update | |
sudo apt-get install python3-pip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pymysql.err.OperationalError: (1698, "Access denied for user 'root'@'localhost'") | |
권한문제이므로 계정의 권한을 변경해 주면 해결된다 | |
$ sudo mysql -u root # sudo를 사용하여 root계정으로 mysql에 접속한다. | |
mysql> USE mysql; | |
mysql> SELECT User, Host, plugin FROM mysql.user; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#커넥터 설치 | |
pip install mysqlclient | |
#settings.py설정 | |
my_settings.py 파일을 생성한 후 | |
DATABASES = { | |
'default':{ | |
'ENGINE':'django.db.backends.mysql', | |
'NAME':'test', #db이름 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install pymysql | |
import pymysql | |
db = pymysql.connect( | |
user='유저이름', | |
passwd='비밀번호', | |
host='127.0.0.1', | |
db='디비이름', | |
charset='utf8' |