
select 和 insert 语句是允许优化和修复所需的最低 MySQL 用户权限。
您可以使用以下语法向用户授予插入和选择权限 -
grant insert,select on yourDatabaseName.* to 'yourUserName'@'localhost';
首先,这是创建用户的查询 -
mysql> create user 'Emma'@'localhost' identified by 'Emma123'; Query OK, 0 rows affected (0.26 sec)
这是为上述用户提供资助的查询 -
mysql> grant insert,select on web.* to 'Emma'@'localhost'; Query OK, 0 rows affected (0.21 sec)
这里是显示上述用户的所有授权的查询 -
mysql> show grants for 'Emma'@'localhost';
这将产生以下输出 -
+-------------------------------------------------------+ | Grants for Emma@localhost | +-------------------------------------------------------+ | GRANT USAGE ON *.* TO `Emma`@`localhost` | | GRANT SELECT, INSERT ON `web`.* TO `Emma`@`localhost` | +-------------------------------------------------------+ 2 rows in set (0.00 sec)
以上就是允许优化和修复的最低 MySQL 用户权限是多少?的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号