MySQL賬戶表是一個關鍵的數據庫結構,用于存儲數據庫用戶的登錄信息和權限。在MySQL中,每個賬戶都有一個唯一的用戶名和密碼。
CREATE TABLE mysql.user ( Host char(60) NOT NULL DEFAULT '', User char(16) NOT NULL DEFAULT '', Password char(41) DEFAULT NULL, Select_priv enum('N','Y') NOT NULL DEFAULT 'N', Insert_priv enum('N','Y') NOT NULL DEFAULT 'N', Update_priv enum('N','Y') NOT NULL DEFAULT 'N', Delete_priv enum('N','Y') NOT NULL DEFAULT 'N', Create_priv enum('N','Y') NOT NULL DEFAULT 'N', Drop_priv enum('N','Y') NOT NULL DEFAULT 'N', Reload_priv enum('N','Y') NOT NULL DEFAULT 'N', Shutdown_priv enum('N','Y') NOT NULL DEFAULT 'N', Process_priv enum('N','Y') NOT NULL DEFAULT 'N', File_priv enum('N','Y') NOT NULL DEFAULT 'N', Grant_priv enum('N','Y') NOT NULL DEFAULT 'N', References_priv enum('N','Y') NOT NULL DEFAULT 'N', Index_priv enum('N','Y') NOT NULL DEFAULT 'N', Alter_priv enum('N','Y') NOT NULL DEFAULT 'N', Show_db_priv enum('N','Y') NOT NULL DEFAULT 'N', Super_priv enum('N','Y') NOT NULL DEFAULT 'N', Create_tmp_table_priv enum('N','Y') NOT NULL DEFAULT 'N', Lock_tables_priv enum('N','Y') NOT NULL DEFAULT 'N', Execute_priv enum('N','Y') NOT NULL DEFAULT 'N', Repl_slave_priv enum('N','Y') NOT NULL DEFAULT 'N', Repl_client_priv enum('N','Y') NOT NULL DEFAULT 'N', Create_view_priv enum('N','Y') NOT NULL DEFAULT 'N', Show_view_priv enum('N','Y') NOT NULL DEFAULT 'N', Create_routine_priv enum('N','Y') NOT NULL DEFAULT 'N', Alter_routine_priv enum('N','Y') NOT NULL DEFAULT 'N', Create_user_priv enum('N','Y') NOT NULL DEFAULT 'N', Event_priv enum('N','Y') NOT NULL DEFAULT 'N', Trigger_priv enum('N','Y') NOT NULL DEFAULT 'N', Create_tablespace_priv enum('N','Y') NOT NULL DEFAULT 'N', ssl_type enum('','ANY','X509','SPECIFIED') DEFAULT NULL, ssl_cipher blob DEFAULT NULL, x509_issuer blob DEFAULT NULL, x509_subject blob DEFAULT NULL, authentication_string text /*!50123 PASSWORD ... */, password_expired enum('N','Y') NOT NULL DEFAULT 'N', password_last_changed timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, password_lifetime smallint(5) unsigned DEFAULT NULL, account_locked enum('N','Y') NOT NULL DEFAULT 'N', PRIMARY KEY (Host,User) ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Users and global privileges';
上面的代碼是MySQL賬戶表的示例。它定義了每個賬戶的字段,如用戶名和密碼,以及該賬戶具有的權限。通過管理MySQL賬戶表,管理員可以輕松地管理和授權數據庫用戶。
上一篇css酷炫的背景框
下一篇css隱藏二級下拉式菜單