doris 数据库基础使用
1.doris修改默认密码,初始密码为空(必须是以本用户登录才能修改本用户的密码)
SET PASSWORD FOR 'root' = PASSWORD('123456');
2.doris创建用户
#所有权限
create user 'doris_user' identified by '123456';
grant all on *.* to doris_user;
#查询权限
CREATE USER 'doris_user'@'10.%' IDENTIFIED BY '123456';
GRANT SELECT_PRIV ON *.* TO 'doris_user'@'10.%';
#增删改查权限
CREATE USER 'doris_user'@'10.%' IDENTIFIED BY '123456';
GRANT SELECT_PRIV,LOAD_PRIV,ALTER_PRIV,CREATE_PRIV,DROP_PRIV ON *.* TO 'doris_user'@'10.%';
删除用户
DROP USER 'doris_user'@'10.%';
3.按天创建分区表
保留7天分区数据,预创建未来3天分区
CREATE TABLE partition_test_table
(
data_time datetime NOT NULL COMMENT '时间(如2024-06-19 00:00:00)',
serial_number VARCHAR(20) NOT NULL COMMENT '电话号码',
user_name VARCHAR(8) NOT NULL COMMENT '用户名称'
)
PARTITION BY RANGE(data_time) ()
DISTRIBUTED BY HASH(data_time)
PROPERTIES
(
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.start" = "-7",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "32"
);
doris 使用指南 :http://cdnd.selectdb.com/zh-CN/docs/1.2/data-table/basic-usage
本文来自博客园,作者:whiteY,转载请注明原文链接:https://www.cnblogs.com/whiteY/p/18375883