签到成功

知道了

CNDBA社区CNDBA社区

TDSQL 集群 SUPER privilege(s) for this operation 错误解决方法

2021-07-30 23:36 2582 0 原创 TDSQL
作者: dave

在TDSQL 集群中,执行命令报如下错误:

http://www.cndba.cn/dave/article/4636

[dave@www.cndba.cn  percona-5.7.17]# mysql -htdsql1 -udave -pdave -P4008
Welcome to the MariaDB monitor.  Commands end with ; or /g.
Your MySQL connection id is 208865
Server version: 5.7.17-11-V2.0R540D002-20191226-1152-log Source distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.

MySQL [(none)]>
MySQL [(none)]> change master to master_host='192.168.31.61',master_port=4002,master_user='slave',master_password='slave',master_log_file='binlog.000002',master_log_pos=40516258;
ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) for this operation
MySQL [(none)]>

实际上类似的权限问题在赋权一块也有问题,参考之前的博客:http://www.cndba.cn/dave/article/4636http://www.cndba.cn/dave/article/4636http://www.cndba.cn/dave/article/4636

TDSQL集群 数据库 命令行 创建用户失败 说明
https://www.cndba.cn/dave/article/4635http://www.cndba.cn/dave/article/4636

http://www.cndba.cn/dave/article/4636

这里的解决方法就是使用jmysql.sh 来执行相关的命令,该工具默认使用超级管理员权限登陆,所以可以执行相应的命令:http://www.cndba.cn/dave/article/4636

http://www.cndba.cn/dave/article/4636

[dave@www.cndba.cn  install]# pwd
/data/tdsql_run/4008/percona-5.7.17/install

[dave@www.cndba.cn  install]# ./jmysql.sh 4008
cmd: e
/data1/tdengine/data/4008/prod/mysql.sock
/data/tdsql_run/4008/percona-5.7.17
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 211048
Server version: 5.7.17-11-V2.0R540D002-20191226-1152-log Source distribution

Copyright (c) 2009-2016 Percona LLC and/or its affiliates
Copyright (c) 2000, 2016, 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> change master to master_host='192.168.31.61',master_port=4002,master_user='slave',master_password='slave',master_log_file='binlog.000002',master_log_pos=40516258;
Query OK, 0 rows affected, 2 warnings (0.13 sec)

mysql>

但是这个命令要慎重使用。 比如我们之前说的创建用户并赋权,直接在mysql 客户端执行会报错,在jmysql.sh 中就可以成功执行,但会导致创建的用户信息无法写入到zk中,而在赤兔中创建的用户是可以写入到zk的:http://www.cndba.cn/dave/article/4636

http://www.cndba.cn/dave/article/4636

[dave@www.cndba.cn  install]# ./jmysql.sh 4008
cmd: e
/data1/tdengine/data/4008/prod/mysql.sock
/data/tdsql_run/4008/percona-5.7.17
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 211048
Server version: 5.7.17-11-V2.0R540D002-20191226-1152-log Source distribution

Copyright (c) 2009-2016 Percona LLC and/or its affiliates
Copyright (c) 2000, 2016, 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> grant replication slave on *.* to 'ustc'@'%' identified by 'ustc';
Query OK, 0 rows affected, 1 warning (0.02 sec)

mysql> show grants for 'ustc'%'%';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%'%'' at line 1
mysql> show grants for 'ustc'@'%';
+----------------------------------------------+
| Grants for ustc@%                            |
+----------------------------------------------+
| GRANT REPLICATION SLAVE ON *.* TO 'ustc'@'%' |
+----------------------------------------------+
1 row in set (0.02 sec)

mysql>

版权声明:本文为博主原创文章,未经博主允许不得转载。

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
dave

dave

关注

人的一生应该是这样度过的:当他回首往事的时候,他不会因为虚度年华而悔恨,也不会因为碌碌无为而羞耻;这样,在临死的时候,他就能够说:“我的整个生命和全部精力,都已经献给世界上最壮丽的事业....."

  • 2261
    原创
  • 3
    翻译
  • 578
    转载
  • 191
    评论
  • 访问:7970481次
  • 积分:4346
  • 等级:核心会员
  • 排名:第1名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ