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

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

      <tfoot id='r5uv5'></tfoot>

      1. <legend id='r5uv5'><style id='r5uv5'><dir id='r5uv5'><q id='r5uv5'></q></dir></style></legend>

        MySQL:授予**所有**数据库权限

        时间:2023-08-19
        • <tfoot id='BfYYs'></tfoot>

          1. <i id='BfYYs'><tr id='BfYYs'><dt id='BfYYs'><q id='BfYYs'><span id='BfYYs'><b id='BfYYs'><form id='BfYYs'><ins id='BfYYs'></ins><ul id='BfYYs'></ul><sub id='BfYYs'></sub></form><legend id='BfYYs'></legend><bdo id='BfYYs'><pre id='BfYYs'><center id='BfYYs'></center></pre></bdo></b><th id='BfYYs'></th></span></q></dt></tr></i><div id='BfYYs'><tfoot id='BfYYs'></tfoot><dl id='BfYYs'><fieldset id='BfYYs'></fieldset></dl></div>
            1. <small id='BfYYs'></small><noframes id='BfYYs'>

                <tbody id='BfYYs'></tbody>
              <legend id='BfYYs'><style id='BfYYs'><dir id='BfYYs'><q id='BfYYs'></q></dir></style></legend>
              • <bdo id='BfYYs'></bdo><ul id='BfYYs'></ul>
                • 本文介绍了MySQL:授予**所有**数据库权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我已经创建了数据库,例如mydb".

                  I've created database, for example 'mydb'.

                  CREATE DATABASE mydb CHARACTER SET utf8 COLLATE utf8_bin;
                  CREATE USER 'myuser'@'%' IDENTIFIED BY PASSWORD '*HASH';
                  GRANT ALL ON mydb.* TO 'myuser'@'%';
                  GRANT ALL ON mydb TO 'myuser'@'%';
                  GRANT CREATE ON mydb TO 'myuser'@'%';
                  FLUSH PRIVILEGES;
                  

                  现在我可以从任何地方登录数据库,但不能创建表.

                  Now i can login to database from everywhere, but can't create tables.

                  如何授予对该数据库和(将来)表的所有权限.我无法在mydb"数据库中创建表.我总是得到:

                  How to grant all privileges on that database and (in the future) tables. I can't create tables in 'mydb' database. I always get:

                  CREATE TABLE t (c CHAR(20) CHARACTER SET utf8 COLLATE utf8_bin);
                  ERROR 1142 (42000): CREATE command denied to user 'myuser'@'...' for table 't'
                  

                  推荐答案

                  GRANT ALL PRIVILEGES ON mydb.* TO 'myuser'@'%' WITH GRANT OPTION;
                  

                  这就是我创建超级用户"的方式权限(虽然我通常会指定一个主机).

                  This is how I create my "Super User" privileges (although I would normally specify a host).

                  虽然这个答案可以解决访问问题,WITH GRANT OPTION 创建了一个 MySQL 用户,它可以 编辑其他用户的权限.

                  While this answer can solve the problem of access, WITH GRANT OPTION creates a MySQL user that can edit the permissions of other users.

                  GRANT OPTION 权限使您能够将您自己拥有的权限授予其他用户或从其他用户中删除.

                  The GRANT OPTION privilege enables you to give to other users or remove from other users those privileges that you yourself possess.

                  出于安全原因,您不应将此类用户帐户用于公众有权访问的任何流程(即网站).建议您创建一个仅具有数据库权限的用户用于此类用途.

                  For security reasons, you should not use this type of user account for any process that the public will have access to (i.e. a website). It is recommended that you create a user with only database privileges for that kind of use.

                  这篇关于MySQL:授予**所有**数据库权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:比较两个 MySQL 数据库 下一篇:安装 mysql2 时出错:无法构建 gem 本机扩展

                  相关文章

                  最新文章

                    <tfoot id='ejIUz'></tfoot>
                  1. <small id='ejIUz'></small><noframes id='ejIUz'>

                        <bdo id='ejIUz'></bdo><ul id='ejIUz'></ul>
                      <legend id='ejIUz'><style id='ejIUz'><dir id='ejIUz'><q id='ejIUz'></q></dir></style></legend>
                    1. <i id='ejIUz'><tr id='ejIUz'><dt id='ejIUz'><q id='ejIUz'><span id='ejIUz'><b id='ejIUz'><form id='ejIUz'><ins id='ejIUz'></ins><ul id='ejIUz'></ul><sub id='ejIUz'></sub></form><legend id='ejIUz'></legend><bdo id='ejIUz'><pre id='ejIUz'><center id='ejIUz'></center></pre></bdo></b><th id='ejIUz'></th></span></q></dt></tr></i><div id='ejIUz'><tfoot id='ejIUz'></tfoot><dl id='ejIUz'><fieldset id='ejIUz'></fieldset></dl></div>