파이썬에서 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. 불필요한 Method 지원여부 확인 1) Options Method step 1) #telnet test.go.kr 80 step 2) OPTIONS /(또는 *) HTTP1.1 step 3) 결과 확인 예) Se...
Recent Posts
Powered by Blogger.