【Python自學筆記】MySQL高級語法(視圖/事務/索引/賬戶管理/MySQL數據備份恢復/MySQL主從)


本文是個人的自學筆記,僅供參考(未整理)

視圖

  • 視圖主要用於數據的查詢

image-20200313165850967

image-20200313165923299

  • 視圖的作用image-20200313170031794

事務

  • 事務的四大特性image-20200313171132540

  • image-20200313171553863

    事務命令

    image-20200313172537340

    image-20200313173131173


索引

  • 創建索引可以大大的提高數據檢索的速度

image-20200313175955502image-20200313181750748


賬戶管理

image-20200313182053633

  • 查看所有用戶image-20200313182635646

  • 創建賬戶&授權

    grant 權限列表 on 數據庫 to '用戶名'@'訪問主機' identified by '密碼';image-20200313183037282image-20200313183607552

賬戶操作

  • 修改賬戶權限

    grant 權限名稱 on 數據庫 to 賬戶@主機 with grant option;

    修改完成後要刷新權限

    flush privileges;

  • 修改密碼命令

    update user set authentication_string=password('新密碼') where user='用戶名';image-20200313185053886

  • 遠程登錄image-20200313185622482

  • 刪除賬戶

    image-20200313190200797

MySQL主從

  • 作用:讀寫分類,數據備份,負載均衡

  • 主從示意圖

    image-20200313191119579

  • 數據庫的備份與恢復image-20200313193842741

  • 主從具體配置

    image-20200313191804982

    image-20200313194700408

    image-20200313194826694

    image-20200313195120481

    image-20200313194922894

    image-20200313195637122

    image-20200313195954066

    image-20200313200100656

    image-20200313200219930