云数据库 TaurusDB
云数据库 TaurusDB
- 最新动态
- 功能总览
- 服务公告
- 产品介绍
- 计费说明
- 快速入门
- 内核介绍
- 用户指南
- 最佳实践
- 性能白皮书
-
API参考
- 使用前必读
- API概览
- 如何调用API
-
API(推荐)
- 查询数据库引擎的版本
- 查询数据库规格
-
实例管理
- 创建数据库实例
- 重启数据库实例
- 删除/退订数据库实例
- 创建只读节点
- 删除/退订只读节点
- 包年/包月实例存储扩容
- 修改实例名称
- 重置数据库密码
- 变更实例规格
- 查询专属资源池列表
- 查询专属资源信息详情
- 设置实例秒级监控
- 查询实例秒级监控
- 节点重启
- 内核版本升级
- 开关SSL
- 绑定弹性公网IP
- 解绑弹性公网IP
- 手动主备倒换
- 设置可维护时间段
- 修改安全组
- 修改内网地址
- 修改实例端口
- 修改实例备注
- 申请内网域名
- 修改内网域名
- 查询内核版本信息
- 设置自动变配
- 查询自动变配
- 资源预校验
- 查询实例列表
- 查询实例详情信息
- 批量查询实例详情
- 设置回收站策略
- 查询回收站策略
- 查询回收站实例信息
- 批量修改节点名称
- 查询自动变配历史记录
- 设置Serverless配置策略
- 修改节点故障倒换优先级
- 查询弹性公网IP
- 备份管理
- 参数模板管理
- 配额管理
- 数据库代理
- 日志管理
- 标签管理
- 数据库用户管理
- 数据库管理
- 流量管理
- 任务中心
- 智能诊断
-
HTAP-标准版
- 恢复StarRocks数据同步
- 暂停StarRocks数据同步
- HTAP数据同步表配置校验
- 创建StarRocks实例
- 查询StarRocks实例
- 删除StarRocks实例
- 重启StarRocks实例
- 重启StarRocks节点
- StarRocks资源检查
- HTAP引擎资源查询
- 获取HTAP实例存储类型
- HTAP查询规格信息
- 查询HTAP实例列表
- 创建StarRocks数据同步
- 删除StarRocks数据同步
- 查询StarRocks数据同步状态信息
- HTAP数据同步库配置校验
- 查询StarRocks数据同步配置信息
- 查询StarRocks数据同步的库参数配置
- 查询StarRocks数据库
- 查询数据库账号
- 创建数据库账号
- 删除数据库账户
- 修改数据库账号密码
- 修改数据库账号权限
- StarRocks实例规格变更
- 查询参数
- 修改参数
- StarRocks实例开启行列分流
- 参数对比
- StarRocks内核版本升级
- 多租特性
- API(即将下线)
- 权限策略和授权项
- 附录
- SDK参考
- 常见问题
-
故障排除
- 备份恢复
- 连接类
-
SQL类
- 建表时timestamp字段默认值无效
- 索引长度限制导致修改varchar长度失败
- delete大表数据后,再查询同一张表时出现慢SQL
- 更新emoji表情数据报错Error 1366
- 存储过程和相关表字符集不一致导致执行缓慢
- 报错ERROR [1412]的解决方法
- 存在外键的表无法删除
- GROUP_CONCAT结果不符合预期
- 创建二级索引报错Too many keys specified
- distinct与group by优化
- 为什么有时候用浮点数做等值比较查不到数据
- 开通数据库代理后,还是有大量select请求分发到主节点
- 表空间膨胀问题
- MySQL创建用户提示服务器错误(ERROR 1396)
- 执行alter table xxx discard/import tablespace报错
- 数据库报错Native error 1461的解决方案
- 创建表失败报错Row size too large的解决方案
- Order by limit分页出现数据重复问题
- 执行select * from sys.innodb_lock_waits报错
- 参数类
- 性能资源类
-
基本使用类
- 查看TaurusDB的存储容量
- 修改库名和修改表名
- 字符集和字符序的默认选择方式
- 自增字段值跳变的原因
- 表的自增AUTO_INCREMENT初值与步长
- 修改表的自增AUTO_INCREMENT值
- 自增主键达到上限,无法插入数据
- 自增字段取值
- 自增属性AUTO_INCREMENT为何未在表结构中显示
- 空用户的危害
- 慢日志显示SQL语句扫描行数为0
- 错误日志页面显示handle_sync_msg_from_slave my_net_read error:-1
- 执行SQL语句报错:ERROR 1290 (HY000): The MySQL server is running with the --sql-replica-on option so it cannot execute this statement的原因及解决方案
- 通用参考
本文导读
展开导读
链接复制成功!
空用户的危害
TaurusDB中是允许用户名为 '' 的用户存在,本章节介绍数据库中存在这种空用户时的危害。
TaurusDB中使用空用户时,它将可以匹配任何用户名。这一特性也会带来多种安全性、功能性危害。所以,在实际使用过程中应避免使用空用户。
- 安全性危害
- 当存在空用户时,连接时可以使用任意用户名进行登录。
- 如果空用户有密码,则使用任意用户名和空用户的密码即可登录数据库,并获得空用户所拥有的所有权限。示例:
#没有空用户时,使用非法用户名‘abcd’,连接失败 mysql> select user,host from mysql.user; +------------------+-----------+ | user | host | +------------------+-----------+ | root | % | | mysql.infoschema | localhost | | mysql.session | localhost | | mysql.sys | localhost | +------------------+-----------+ mysql -uabcd -h127.0.0.1 -P3306 -pTest_1234 mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 1045 (28000): Access denied for user 'abcd'@'localhost' (using password: YES) # 创建空用户后,使用非法用户名‘abcd’,密码用空用户的密码,连接成功 mysql> create user ''@'localhost' IDENTIFIED BY 'Test_1234'; mysql> select user,host from mysql.user; +------------------+-----------+ | user | host | +------------------+-----------+ | root | % | | | localhost | | mysql.infoschema | localhost | | mysql.session | localhost | | mysql.sys | localhost | +------------------+-----------+ mysql -uabcd -h127.0.0.1 -P3306 -pTest_1234 mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 37Server version: 8.0.22-debug Source distribution Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
- 如果空用户没有密码,则使用任意用户名即可免密登录数据库,并获得空用户所拥有的所有权限。示例:
#存在无密码的空用户时,可以使用任意用户免密登录数据库。 mysql> create user ''@'localhost'; Query OK, 0 rows affected (8.87 sec) mysql> select user,host from mysql.user; +------------------+-----------+ | user | host | +------------------+-----------+ | root | % | | | localhost | | mysql.infoschema | localhost | | mysql.session | localhost | | mysql.sys | localhost | +------------------+-----------+ mysql -uabcd -h127.0.0.1 -P3306 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 39Server version: 8.0.22-debug Source distribution Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> #----------------- mysql -usdhsjkdshk -h127.0.0.1 -P3306 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 40Server version: 8.0.22-debug Source distribution Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
- 功能性危害
当存在空用户时,可能因为匹配出错,导致正常的用户名无法登录。
示例:存在空用户与root用户的host有重叠时,导致root用户无法使用密码登录,或者使用空用户的密码登录后无法进入root的权限。
mysql> create user ''@'localhost'; Query OK, 0 rows affected (8.87 sec) mysql> select user,host from mysql.user; +------------------+-----------+ | user | host | +------------------+-----------+ | root | % | | | localhost | | mysql.infoschema | localhost | | mysql.session | localhost | | mysql.sys | localhost | +------------------+-----------+ # 用root的密码无法登录 mysql -uroot -h127.0.0.1 -P3306 -pTest_root mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) # 用空用户的密码(免密)登录后实际是空用户登录,没有root权限。 mysql -uroot -h127.0.0.1 -P3306 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 45Server version: 8.0.22-debug Source distribution Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select user,host from mysql.user; ERROR 1142 (42000): SELECT command denied to user ''@'localhost' for table 'user'
父主题: 基本使用类