应该在mysql中为网站数据库用户/客户端设置哪些特权 [英] which privileges should be set for website database user / client in mysql

查看:74
本文介绍了应该在mysql中为网站数据库用户/客户端设置哪些特权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

那么应该为将被用作网站主要"用户的mysql用户设置哪些特权?

So what privileges should be set for the mysql user that is to be used as 'main' user for the website?

我在考虑应该为使用的数据库设置数据和结构(请参见下文).但是我还需要添加管理权限吗?如果您拥有Web服务器并向客户端授予特权(例如,希望您为其托管网站),授予他们在自己的数据库上使用phpmyadmin的权限,这会有所不同.

I'm thinking data and structure ( see below ) for the database that is used should be set. But do i need to add administration rights also? And would this be any different if you own a web server and grant privileges to a client that for example want you to host an website for them giving them rights to use phpmyadmin on there own databases.

数据

SELECT
INSERT
UPDATE
DELETE
FILE 

结构

CREATE
ALTER
INDEX
DROP
CREATE TEMPORARY TABLES
SHOW VIEW
CREATE ROUTINE
ALTER ROUTINE
EXECUTE
CREATE VIEW
EVENT
TRIGGER 

管理

GRANT
SUPER
PROCESS
RELOAD
SHUTDOWN
SHOW DATABASES
LOCK TABLES
REFERENCES
REPLICATION CLIENT
REPLICATION SLAVE
CREATE USER 

推荐答案

对于网站用户(您的应用程序用来连接到数据库),简单的SELECTINSERTUPDATEDELETE权限应足够.在大多数情况下,您的网站不应真正修改表的结构(这可能表示数据库设计不正确).您只想在这里处理数据.

For a website user (that your application uses to connect to your database) simple SELECT, INSERT, UPDATE, DELETE rights should be enough. In most situations, your website should not really modify the structure of your tables (that might indicate bad database design). You only want to deal with data here.

如果您要谈论的用户还需要修改结构化内容,设计和创建表(例如用于phpMyAdmin的表),那么您当然需要数据和结构"权限.我不会说政府.

If you are talking about a user that also needs to modify structural things, design and create tables, like one used for phpMyAdmin, you certainly need the Data and Structure rights. No Administration I'd say.

这篇关于应该在mysql中为网站数据库用户/客户端设置哪些特权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆