(一) mysql解壓版安裝的root密碼設(shè)置和初始化缠犀,或者忘記root密碼時(shí)
- 關(guān)閉正在運(yùn)行的Mysql服務(wù)
- 打開DOS窗口陌知, 切到
mysql/bin
目錄呻引,輸入mysqld --skip-grant-tables
回車考蕾, --skip-grant-tables
意思是啟動(dòng)MySQL服務(wù)的時(shí)候跳過權(quán)限表認(rèn)證祸憋。
- 再開一個(gè)DOS窗口(因?yàn)閯偛拍莻€(gè)已經(jīng)不能動(dòng)了)内地,輸入Mysql回車唉工,如果成功,將出現(xiàn)MySQL提示符
>
,
- 連接權(quán)限數(shù)據(jù)庫:
use mysql;
- 修改密碼:
update user set password=password("root") where user = "root";
-
刷新權(quán)限童谒,一定要有:
flush privileges;
- 退出:
quit
- 重啟Mysql服務(wù),用
root
用戶名和剛才設(shè)置的密碼登陸就OK拦赠。
(二) flask框架前后端交互
- bootstrap披上flask的框架還是bootstrap——flask-bootstrap框架里的樣式
class
名和bootstrap里的一樣巍沙,flask用的時(shí)候,只需要在模板(templates文件夾)下的html里的base.html
繼承bootstrap({% extends "bootstrap/base.html" %}
)
- flask里的通信方式:基于HTTP
- flask的程序架構(gòu):
app
下:templates(.html)
,static(.js, .css)
, main(__init__.py)
- 前后端的數(shù)據(jù)通信:
{{value}}(html里)
荷鼠,后端python代碼里返回值得渠道:renturn render_template("xxx.html", value_to_html = data_here)(data_here是后端數(shù)據(jù)句携,value_to_html是前臺html里顯示的內(nèi)容)
- 路由方法:
@app.route("/", methods=['GET', 'POST'])
def index():
```
- python 與Mysql交互:安裝`mysqldb`,然后用這個(gè)來`存取數(shù)據(jù)`允乐。
---
>#### (附) 安全工程師技能圖譜:

最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者