MySQL与Oracle数据库在网络安全等级方面用到的命令

发布时间:2024年01月05日
  • MySQL数据库命令集
查看数据库版本
SELECT VERSION();
空口令查询
SELECT user,host,account_locked  FROM mysql.user WHERE user = '';
SELECT *  FROM mysql.user;
查询 用户的密码加密情况
SELECT HOST,USER,PLUGIN FROM mysql.`user`;
查询是否有空用户
SELECT host,user,plugin  FROM mysql.user WHERE user = '';
口令定期更换
SELECT host,user,password_lifetime, plugin FROM mysql.user;
是否口令复杂度模块
SELECT * FROM information_schema.PLUGINS WHERE PLUGIN_NAME='validate_password';
口令复杂度策略
SHOW VARIABLES LIKE 'validate_password%';
show variables like 'validate%';
超时连接退出
SHOW VARIABLES LIKE '%timeout%';
登录失败处理模块
SELECT * FROM information_schema.PLUGINS WHERE PLUGIN_NAME='connection_control';
SHOW VARIABLES LIKE 'connection_control%';
日志是否开启
SHOW variables LIKE 'general_log%';
权限分配
SELECT *  FROM mysql.user;
SELECT *  FROM mysql.db;
SELECT *  FROM mysql.tables_priv;
SELECT *  FROM mysql.columns_priv;
完整性
SHOW variables LIKE 'require_secure_transport';
SHOW variables LIKE '%ssl%';
SELECT user, password_expired FROM mysql.user;
  • Oracle数据库命令
SELECT USERNAME,USER_ID FROM DBA_USERS WHERE ACCOUNT_STATUS='OPEN'
SELECT USERNAME,PROFILE FROM DBA_USERS WHERE ACCOUNT_STATUS='OPEN'
SELECT * FROM DBA_PROFILES WHERE RESOURCE_TYPE= 'PASSWORD'
SELECT USERNAME,PROFILE FROM DBA_USERS WHERE ACCOUNT_STATUS='OPEN'
SELECT * FROM DBA_PROFILES WHERE RESOURCE_TYPE='PASSWORD'
SELECT * FROM DBA_PROFILES WHERE RESOURCE_TYPE='KERNEL'
权限:
SELECT * FROM DBA_ROLE_PRIVS;系统预设角色
SELECT * FROM DBA_SYS_PRIVS;
SELECT * FROM DBA_TAB_PRIVS;
SELECT * FROM DBA_COL_PRIVS;
SELECT USERNAME FROM DBA_USERS WHERE ACCOUNT_STATUS='OPEN'
SELECT USERNAME FROM DBA_USERS WHERE ACCOUNT_STATUS='OPEN'
SELECT * FROM DBA_ROLE_PRIVS
SELECT * FROM DBA_ROLE_PRIVS
SELECT * FROM DBA_ROLE_PRIVS
日志:
SHOW PARAMETER AUDIT;
SELECT * FROM DBA_STMT_AUDIT_OPTS;
SELECT * FROM DBA_PRIV_AUDIT_OPTS;
SELECT * FROM DBA_OBJ_AUDIT_OPTS;

文章来源:https://blog.csdn.net/weixin_44950652/article/details/135414873
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。