Mysql 8.0.19:skip-grant-table:新變化:坑


  • --skip-grant-tables

    Property Value
    Command-Line Format --skip-grant-tables[={OFF|ON}]
    Type Boolean
    Default Value OFF

    This option affects the server startup sequence:

    • --skip-grant-tables causes the server not to read the grant tables in the mysql system schema, and thus to start without using the privilege system at all. This gives anyone with access to the server unrestricted access to all databases.

      To cause a server started with --skip-grant-tables to load the grant tables at runtime, perform a privilege-flushing operation, which can be done in these ways:

      Privilege flushing might also occur implicitly as a result of other actions performed after startup, thus causing the server to start using the grant tables. For example, mysql_upgrade flushes the privileges during the upgrade procedure.

    • In addition to causing the startup sequence not to load the grant tables, --skip-grant-tables causes the server not to load certain other objects stored in the mysql system schema: plugins that were installed with the INSTALL PLUGIN statement, scheduled events, and user-defined functions (UDFs). To cause plugins to be loaded anyway, use the --plugin-load or --plugin-load-add option.

      --skip-grant-tables does not suppress loading of server components during startup.

    • --skip-grant-tables disables failed-login tracking and temporary account locking because those capabilities depend on the grant tables. See Section 6.2.15, “Password Management”.

    • --skip-grant-tables causes the disabled_storage_engines system variable to have no effect.

    Because starting the server with --skip-grant-tables disables authentication checks, the server also disables remote connections in that case by enabling skip_networking.

 

 

  • skip_networking

    Property Value
    Command-Line Format --skip-networking[={OFF|ON}]
    System Variable skip_networking
    Scope Global
    Dynamic No
    SET_VAR Hint Applies No
    Type Boolean
    Default Value OFF

    This variable controls whether the server permits TCP/IP connections. By default, it is disabled (permit TCP connections). If enabled, the server permits only local (non-TCP/IP) connections and all interaction with mysqld must be made using named pipes or shared memory (on Windows) or Unix socket files (on Unix). This option is highly recommended for systems where only local clients are permitted. See Section 8.12.4.2, “DNS Lookup Optimization and the Host Cache”.

    Because starting the server with --skip-grant-tables disables authentication checks, the server also disables remote connections in that case by enabling skip_networking.

 

----------------------------------------------------------------------------------------------------------------------------------------------------------

大意:skip-grant-tables 啟用后有幾個后果:

  1. 權限系統沒了,任何人都是最高權限!
  2. 插件系統沒了
  3. 計划調度沒了
  4. 用戶定義函數沒了
  5. 失敗登錄跟蹤沒了
  6. 臨時賬號鎖定沒了
  7. disabled-storage-engines系統變量失效了
  8. TCP/IP網絡訪問沒了!相當於強制實施skip-networking! 坑!坑!坑!

----------------------------------------------------------------------------------------------------------------------------------------------------------

萬一你使用了skip-grant-tables,怎么在不重啟mysqld的情況下,立即使用權限系統呢?

  1. 直接執行flush privileges這個sql語句
  2. 通過管理工具 mysqladmin flush-privileges
  3. 通過管理工具mysqladmin reload
  4. 通過升級工具mysql_upgrade

 

----------------------------------------------------------------------------------------------------------------------------------------------------------

如何在使用了skip-grant-tablesd的情況下,使用插件系統呢?

  1. plugin-load選項
  2. plugin-load-add選項

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM