代码编织梦想

创建并赋权

# 登录root用户下的starrock
[root@master ~]# mysql -h 192.168.1.1 -P 9030 -uroot -p123456
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 610
Server version: 5.1.0 StarRocks version 2.1.3

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

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> CREATE USER 'test' IDENTIFIED BY 'test';
Query OK, 0 rows affected (0.00 sec)

# 创建数据库
mysql> create database doris;
Query OK, 0 rows affected (0.00 sec)
mysql> create database test;
Query OK, 0 rows affected (0.00 sec)

# 赋权
mysql> grant all on test to test;
Query OK, 0 rows affected (0.00 sec)
mysql> grant all on doris to test;
Query OK, 0 rows affected (0.00 sec)

# 退出root用户
mysql> 
[5]+  已停止               mysql -h 192.168.1.1 -P 9030 -uroot -p123456

# 登录test用户
[root@master ~]# mysql -h 192.168.1.1 -P 9030 -utest -ptest
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 615
Server version: 5.1.0 StarRocks version 2.1.3

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

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> show databases;
+--------------------+
| Database           |
+--------------------+
| doris              |
| information_schema |
| test               |
+--------------------+
3 rows in set (0.00 sec)

mysql> use test;
Database changed
mysql> show tables;
Empty set (0.00 sec)

mysql> 

在这里插入图片描述

取消赋权

# 登录root用户下的starrock
[root@master ~]# mysql -h 192.168.1.1 -P 9030 -uroot -p123456
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 610
Server version: 5.1.0 StarRocks version 2.1.3

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

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> revoke all on test from test;
Query OK, 0 rows affected (0.00 sec)

在这里插入图片描述

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/Davina_yu/article/details/125184192

linux创建新用户并将为其赋予权限_wkcaeser_的博客-爱代码爱编程

以下命令都在root用户下操作 创建新用户es: adduser es 为es用户设置密码 passwd es #后面会让输入两次密码 将为es用户赋予某个文件夹权限: #文件夹归属组 #chown -R [用

oracle创建数据实例和新用户并赋权_段先生~的博客-爱代码爱编程

创建oracle数据库实例 参考链接:https://jingyan.baidu.com/article/76a7e409f3f37bfc3b6e15de.html 创建新用户,授权创建表(这里我是讲dba用户的权限给了新的用户[dba是拥有最高权限]) 步骤; 1.按照下面截图找到sql plus .   2.输入用户名:system,密码

创建用户并赋权_sixgod_0807的博客-爱代码爱编程_给用户赋权

1.用有dba权限的用户登录:sys用户 sqlplus / as sysdba; 2.创建一个新用户:create user hr identified by username;   3.给用户授权 GRANT   CREATE SESSION, CREATE ANY TABLE, CREATE ANY VIEW ,CREATE ANY IN

mysql 创建用户并且为用户进行赋权的操作_justdoit180的博客-爱代码爱编程_mysql赋权给用户

mysql 创建用户并且为用户进行赋权的操作 登录MySQL mysql -u root -p111111 1、添加新用户 --- 允许本地 IP 访问 localhost, 127.0.0.1 create use

oracle表空间创建、新用户创建并赋权-爱代码爱编程

因为这一次是在已经安装的Oracle库上新增一个数据库,但以往用Mysql的话在Navicat上操作就OK了,但这次Oracle却不能这么干,只好在服务器上跑命令了 百度了一下,基本都是差不多的操作,但在创建表空间的时候,不知道该分配多大,前后两个xxxM的参数是什么意思我也不知道,于是只好问了一下前辈以往的库分配大小,在这里仅做记录吧,有空再研究这俩参

Doris 创建复合分区表和动态分区表-爱代码爱编程

Doris 创建复合分区表和动态分区表 一、分区与分桶 二、创建复合分区表 1.Partition 2.Bucker 3.关于 Partition 和 Bucket 的数量和数据量的建议 4.增加分区 三、创建动态分区表 一、分区与分桶 Doris 支持两层的数据划分。creat

简单程序实现 mysql 表创建sql 转成 doris 表创建sql-爱代码爱编程

1,导入依赖 <dependency> <groupId>com.github.jsqlparser</groupId> <artifactId>jsqlparser</artifactId> <version>3.1</version> <

创建mysql新用户,并且赋予权限管理-爱代码爱编程

因业务需要 需为不同的数据库创建用户 并授权 在稍微大一点的公司里面都是进行着明显的权限管理。特别是操作数据库这样重要的东西,万一你要是一不小心删库了,就麻烦了,所以在公司里面一般一个项目 都会创建一个专门的用户指定其权限只能控制某一个数据库进行操作。 这样就可很合理的进行项目了。   要创建一个新的mysql用户的话,需要在root用户里面进行操

Apache Doris创建用户、数据库和表创建、数据insert和查询、表结构变更、join操作、高可用、查询参数设置-爱代码爱编程

目录 1. 基本使用指南1.1 修改密码1.2 创建用户并授权1.3 语法帮助命令1.4 创建数据库1.5 表的创建1.6 insert数据1.7 查询数据2. 高级使用指南2.1 表结构变更2.2 数据表的查询2.2.1 内存限制2.2.2 查询超时时间2.2.3 broadcast join和shuffle join2.2.4 查询重试和高可用

Doris创建外部表-爱代码爱编程

drop table if exists mysql_factfinance; CREATE EXTERNAL TABLE mysql_factfinance ( DateKey INT, Amount double, Date date ) ENGINE=ODBC PROPERTIES ( "host" = "192.168.xx.x

OLAP工具Apache Doris或StarRocks集群安装-爱代码爱编程

StarRocks或Doris集群安装 下载 StarRockes 2.0.1版本下载地址 https://cdn-release.starrocks.com/StarRocks-2.0.1.tar.gz?Expires=1646120596&OSSAccessKeyId=LTAI4GE6QnJq4iytf6SawLgb&Signat

Apache Doris创建动态分区-爱代码爱编程

动态分区使用场景 在某些使用场景下,用户会将表按照天进行分区划分,每天定时执行例行任务,这时需要使用方手动管理分区,否则可能由于使用方没有创建分区导致数据导入失败,这给使用方带来了额外的维护成本。 通过动态分区功能,用户可以在建表时设定动态分区的规则。FE 会启动一个后台线程,根据用户指定的规则创建或删除分区。用户也可以在运行时对现有规则进行变更。

doris 用户权限_doris授权grant-爱代码爱编程

和MySQL相差不多,在Doris中,GRANT 命令用于赋予指定用户或角色指定的权限。 使用语法如下: GRANT privilege_list ON db_name[.tbl_name] TO user_identity [ROLE role_name] GRANT privilege_list ON RESOURCE re