<tfoot id='PL7Ya'></tfoot>
  • <i id='PL7Ya'><tr id='PL7Ya'><dt id='PL7Ya'><q id='PL7Ya'><span id='PL7Ya'><b id='PL7Ya'><form id='PL7Ya'><ins id='PL7Ya'></ins><ul id='PL7Ya'></ul><sub id='PL7Ya'></sub></form><legend id='PL7Ya'></legend><bdo id='PL7Ya'><pre id='PL7Ya'><center id='PL7Ya'></center></pre></bdo></b><th id='PL7Ya'></th></span></q></dt></tr></i><div id='PL7Ya'><tfoot id='PL7Ya'></tfoot><dl id='PL7Ya'><fieldset id='PL7Ya'></fieldset></dl></div>
      <bdo id='PL7Ya'></bdo><ul id='PL7Ya'></ul>

      <legend id='PL7Ya'><style id='PL7Ya'><dir id='PL7Ya'><q id='PL7Ya'></q></dir></style></legend>

      <small id='PL7Ya'></small><noframes id='PL7Ya'>

      1. 让 MySQL 用户创建数据库,但只允许访问他们自己的数据库

        Let MySQL users create databases, but allow access to only their own databases(让 MySQL 用户创建数据库,但只允许访问他们自己的数据库)
          <tfoot id='7BBx9'></tfoot>

          <small id='7BBx9'></small><noframes id='7BBx9'>

            <tbody id='7BBx9'></tbody>
          <i id='7BBx9'><tr id='7BBx9'><dt id='7BBx9'><q id='7BBx9'><span id='7BBx9'><b id='7BBx9'><form id='7BBx9'><ins id='7BBx9'></ins><ul id='7BBx9'></ul><sub id='7BBx9'></sub></form><legend id='7BBx9'></legend><bdo id='7BBx9'><pre id='7BBx9'><center id='7BBx9'></center></pre></bdo></b><th id='7BBx9'></th></span></q></dt></tr></i><div id='7BBx9'><tfoot id='7BBx9'></tfoot><dl id='7BBx9'><fieldset id='7BBx9'></fieldset></dl></div>

                <legend id='7BBx9'><style id='7BBx9'><dir id='7BBx9'><q id='7BBx9'></q></dir></style></legend>

                • <bdo id='7BBx9'></bdo><ul id='7BBx9'></ul>

                  本文介绍了让 MySQL 用户创建数据库,但只允许访问他们自己的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想要多个一个 MySQL 用户能够发出像

                  I want to have multiple a MySQL users to be able to issue commands like

                  CREATE DATABASE dbTest;
                  

                  但我也希望这些用户中的每一个都只能查看和访问他们自己的数据库.

                  But I also want each of these users to be able to see and access only their own databases.

                  我所能找到的只是如何由 DBA 创建数据库并将此数据库的权限授予特定用户:

                  All I could find was how to either create the databases by a DBA and grant the privileges on this database to the specific user:

                  GRANT ALL PRIVILEGES ON dbTest.* TO 'user';
                  

                  或将所有数据库的权限授予用户:

                  or grant privileges on all databases to a user:

                  GRANT ALL PRIVILEGES ON *.* TO 'user';
                  

                  但两者都不是我想要的,因为它需要扩展和安全.

                  But neither is what I want, because it needs to scale and be secure.

                  推荐答案

                  您可以使用

                  GRANT ALL PRIVILEGES ON `testuser\_%` .  * TO 'testuser'@'%';
                  

                  授予用户 testuser 对名称以 testuser_ 开头的所有数据库的权限.

                  to grant the user testuser privileges on all databases with names beginning with testuser_.

                  这允许 testuser 创建仅限于以 testuser_ 开头的名称的数据库

                  This allows the testuser to create databases limited to names starting with testuser_

                  这篇关于让 MySQL 用户创建数据库,但只允许访问他们自己的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Bogus foreign key constraint fail(虚假外键约束失败)
                  how to get last insert id after insert query in codeigniter active record(如何在codeigniter活动记录中插入查询后获取最后一个插入ID)
                  Force InnoDB to recheck foreign keys on a table/tables?(强制 InnoDB 重新检查表/表上的外键?)
                  How to auto generate migrations with Sequelize CLI from Sequelize models?(如何使用 Sequelize CLI 从 Sequelize 模型自动生成迁移?)
                  Clear MySQL query cache without restarting server(无需重启服务器即可清除 MySQL 查询缓存)
                  ALTER TABLE to add a composite primary key(ALTER TABLE 添加复合主键)
                  <i id='Xdutz'><tr id='Xdutz'><dt id='Xdutz'><q id='Xdutz'><span id='Xdutz'><b id='Xdutz'><form id='Xdutz'><ins id='Xdutz'></ins><ul id='Xdutz'></ul><sub id='Xdutz'></sub></form><legend id='Xdutz'></legend><bdo id='Xdutz'><pre id='Xdutz'><center id='Xdutz'></center></pre></bdo></b><th id='Xdutz'></th></span></q></dt></tr></i><div id='Xdutz'><tfoot id='Xdutz'></tfoot><dl id='Xdutz'><fieldset id='Xdutz'></fieldset></dl></div>

                    <legend id='Xdutz'><style id='Xdutz'><dir id='Xdutz'><q id='Xdutz'></q></dir></style></legend>
                        <tbody id='Xdutz'></tbody>

                      <small id='Xdutz'></small><noframes id='Xdutz'>

                      <tfoot id='Xdutz'></tfoot>

                        • <bdo id='Xdutz'></bdo><ul id='Xdutz'></ul>