91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2KB
    文件類型: .py
    金幣: 2
    下載: 1 次
    發布日期: 2021-06-18
  • 語言: Python
  • 標簽: MySQL??root??

資源簡介

mysql root用戶誤刪除一鍵恢復,使用python 腳本一鍵恢復

資源截圖

代碼片段和文件信息

import?pymysql
import?os
#修改配置文件獲取權限
print(“modify?my.cnf?skip?grant?tables.........“)
os.system(“echo‘-skip-grant-tables‘>>/etc/my.cnf“)
k?=?os.system(“systemctl?restart?mysqld“)
if?k==0:
????pint(“erro:“k)
else:
????print(“modify?success!“)
????#連接數據庫
????db=pymysql.connect(“127.0.0.1“)
????cursor=db.cursor()
????cursor.execute(“use?mysql“)

????#添加root用戶并更新root權限
????SQL_SYN=“insert?into?user(Userauthentication_stringssl_cipher?x509_issuer?x509_subject)?values(‘root‘‘‘‘‘‘‘‘‘)“
????cursor.execute(SQL_SYN)
????SQL_SYN=“update?user?set?Host=‘%‘select_priv=‘y‘?insert_priv=‘y‘update_priv=‘y‘Alter_priv=‘y‘delete_priv=‘y‘create_priv=‘y‘drop_priv=‘y‘reload_priv=‘y‘shutdown_priv=‘y‘Process_priv=‘y‘file_priv=‘y‘grant_priv=‘y‘References_priv=‘y‘index_priv=‘y‘create_user_priv=‘y‘show_db_priv=‘y‘super_priv=‘y‘create_tmp_table_priv=‘y‘Lock_tables_priv=‘

評論

共有 條評論