파이썬에서 mysql 을 사용하려면 pymysql 모듈을 pip로 설치해야 한다.
import pymysql
conn = pymysql.connect(host='localhost', user='root', passwd='비밀번호', db='scraping')
cur = conn.cursor()
cur.execute("SELECT * FROM pages WHERE id=1")
print(cur.fetchall())
cur.close()
conn.close()
Popular Posts
-
/* PHP Version URL CMD WebShell */ /* 사용법 : hxxp://URL/cmd.php?cmd=명령어 */ <? echo " <FORM ACTIO...
-
해쉬함수별 출력값(해쉬값) 길이 비교 1. md5의 출력값 길이는 128비트 md5 hash값(저장 : 16진수로 32바이트) ex) 8380482228e75045a7d14e063bde014b 2. sha-1의 출력값 길이는 160비트 s...
Recent Posts
Powered by Blogger.