- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在尝试授予用户对 mysql 中特定数据库的访问权限。但是命令好像没有生效。
我的意思是:
第一步:
root@bnode1/]# mysql -h 172.22.191.202 -u root -ppassword
MariaDB [(none)]>
MariaDB [(none)]> CREATE DATABASE IF NOT EXISTS testdb;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all privileges on testdb.* to 'dummyuser'@'%' identified by 'password';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit
Bye
[root@bnode1 /]#
[root@bnode1 /]# mysql -h 172.22.191.202 -u dummyuser -ppassword
ERROR 1045 (28000): Access denied for user 'dummyuser'@'bnode1' (using password: YES)
在 mysql 数据库上,我可以看到 dummyuser 的授予权限如下:
MariaDB [(none)]> show grants for 'dummyuser';
+-----------------------------------------+
| Grants for dummyuser@% |
+-----------------------------------------+
| GRANT USAGE ON *.* TO 'dummyuser'@'%' IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19' |
| GRANT ALL PRIVILEGES ON `testdb`.* TO 'dummyuser'@'%' |
+-----------------------------------------+
2 rows in set (0.00 sec)
第 2 步:现在我尝试了另一件事。授予用户 'dummyuser'@'bnode1' 权限,相同的命令,现在我可以访问了。
root@bnode1 /]# mysql -h 172.22.191.202 -u root -ppassword
Welcome to the MariaDB monitor. Commands end with ; or \g.
...
MariaDB [(none)]> grant all privileges on testdb.* to '**dummyuser'@'bnode1'** identified by 'passwor>
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit
Bye
[root@bnode1 /]#
[root@bnode1 /]#
[root@bnode1 /]# mysql -h 172.22.191.202 -u dummyuser -ppassword
Welcome to the MariaDB monitor. Commands end with ; or \g.
...
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
我不是 mysql 专家,谁能给我解释一下我做错了什么。
最佳答案
ERROR 1045 (28000): Access denied for user 'dummyuser'@'bnode1' (using password: YES)
您可能需要尝试从其他主机连接以查看“bnode1”是否被“dummyuser”限制
或者您可以创建一个新用户(因为您没有显示创建用户命令,我假设它是一个现有用户)并且您执行的授权命令应该可以工作。
不太可能,但以防万一,您需要确保 my.cnf 中的 'bind=0.0.0.0'。
关于MySQL - 授予访问权限不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29176236/
今天有小伙伴给我留言问到,try{...}catch(){...}是什么意思?它用来干什么? 简单的说 他们是用来捕获异常的 下面我们通过一个例子来详细讲解下
我正在努力提高网站的可访问性,但我不知道如何在页脚中标记社交媒体链接列表。这些链接指向我在 facecook、twitter 等上的帐户。我不想用 role="navigation" 标记这些链接,因
说现在是 6 点,我有一个 Timer 并在 10 点安排了一个 TimerTask。之后,System DateTime 被其他服务(例如 ntp)调整为 9 点钟。我仍然希望我的 TimerTas
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我就废话不多说了,大家还是直接看代码吧~ ? 1
Maven系列1 1.什么是Maven? Maven是一个项目管理工具,它包含了一个对象模型。一组标准集合,一个依赖管理系统。和用来运行定义在生命周期阶段中插件目标和逻辑。 核心功能 Mav
我是一名优秀的程序员,十分优秀!