首先我们来阐述服务器(实例级别)的权限,实例级别和数据库级别权限的最大不同在于:实例级别的权限是直接授权给登录名,而数据库级别的全显示授予数据库用户的,然后数据库用户再与登录名匹配。(再SqlServer中,登录名和用户是两个概念,登录名用于登录到
首先我们来阐述服务器(实例级别)的权限,实例级别和数据库级别权限的最大不同在于:实例级别的权限是直接授权给登录名,而数据库级别的全显示授予数据库用户的,然后数据库用户再与登录名匹配。(再SqlServer中,登录名和用户是两个概念,登录名用于登录到数据库实例,而用户位于数据库之内,用于和登录名匹配)
举例:
--指定登录名为dbtester,并且创建test数据库中的用户tester1 execute sp_grantdbaccess ‘dbtester’,'tester1'
在服务器(实例)范围内,对于不同的对象也可以授予不同的权限,主要有以下几种:端点,登录名,高可用性组,自定义服务器角色,固定服务器角色。利用sys.server_principals和sys.server_permissions 这两个视图可以查看已经被授予的权限。
示例:
其中我们要注意,Control Server 授予用户超级管理员的权限,可以让用户拥有对SqlServer的最高控制权,所以一般不要授予这个权限。
重点介绍一下固定服务器的角色,一共是九个分别是:
sysadmin
执行SQL Server中的任何动作,也是对任何数据库的任何操作的权限。
serveradmin
配置服务器设置,并可使用SHUTDOWN来停止实例的权限。
setupadmin
向该服务器角色中添加其他登录,添加、删除或配置链接的服务器,执行一些系统过程,如sp_serveroption。
securityadmin
用于管理登录名、读取错误日志和创建数据库许可权限的登录名,可以执行关于服务器访问和安全的所有动作。
processadmin
管理SQL Server进程,在实例中杀死其他用户进程的权限。
dbcreator
创建和修改数据库
diskadmin
管理物理数据库的权限。
bulkadmin
向数据库批量插入数据的权限(SqlServer2005中被添加进来)
public
本身不授予其他成员任何权限。只有连接权限。
固定数据库角色在数据库层上进行定义,因此它们存在于属于数据库服务器的每个数据库中。列出了所有的固定数据库角色。
db_owner
可以执行数据库中技术所有动作的用户
db_accessadmin
可以添加、删除用户的用户
db_datareader
可以查看所有数据库中用户表内数据的用户
db_datawriter
可以添加、修改或删除所有数据库中用户表内数据的用户
db_ddladmin
可以在数据库中执行所有DDL操作的用户
db_securityadmin
可以管理数据库中与安全权限有关所有动作的用户
db_backoperator
可以备份数据库的用户(并可以发布DBCC和CHECKPOINT语句,这两个语句一般在备份前都会被执行)
db_denydatareader
不能看到数据库中任何数据的用户
db_denydatawriter
不能改变数据库中任何数据的用户
参考:http://www.cnblogs.com/dannyli/archive/2012/09/18/2690740.html

ACID attributes include atomicity, consistency, isolation and durability, and are the cornerstone of database design. 1. Atomicity ensures that the transaction is either completely successful or completely failed. 2. Consistency ensures that the database remains consistent before and after a transaction. 3. Isolation ensures that transactions do not interfere with each other. 4. Persistence ensures that data is permanently saved after transaction submission.

MySQL is not only a database management system (DBMS) but also closely related to programming languages. 1) As a DBMS, MySQL is used to store, organize and retrieve data, and optimizing indexes can improve query performance. 2) Combining SQL with programming languages, embedded in Python, using ORM tools such as SQLAlchemy can simplify operations. 3) Performance optimization includes indexing, querying, caching, library and table division and transaction management.

MySQL uses SQL commands to manage data. 1. Basic commands include SELECT, INSERT, UPDATE and DELETE. 2. Advanced usage involves JOIN, subquery and aggregate functions. 3. Common errors include syntax, logic and performance issues. 4. Optimization tips include using indexes, avoiding SELECT* and using LIMIT.

MySQL is an efficient relational database management system suitable for storing and managing data. Its advantages include high-performance queries, flexible transaction processing and rich data types. In practical applications, MySQL is often used in e-commerce platforms, social networks and content management systems, but attention should be paid to performance optimization, data security and scalability.

The relationship between SQL and MySQL is the relationship between standard languages and specific implementations. 1.SQL is a standard language used to manage and operate relational databases, allowing data addition, deletion, modification and query. 2.MySQL is a specific database management system that uses SQL as its operating language and provides efficient data storage and management.

InnoDB uses redologs and undologs to ensure data consistency and reliability. 1.redologs record data page modification to ensure crash recovery and transaction persistence. 2.undologs records the original data value and supports transaction rollback and MVCC.

Key metrics for EXPLAIN commands include type, key, rows, and Extra. 1) The type reflects the access type of the query. The higher the value, the higher the efficiency, such as const is better than ALL. 2) The key displays the index used, and NULL indicates no index. 3) rows estimates the number of scanned rows, affecting query performance. 4) Extra provides additional information, such as Usingfilesort prompts that it needs to be optimized.

Usingtemporary indicates that the need to create temporary tables in MySQL queries, which are commonly found in ORDERBY using DISTINCT, GROUPBY, or non-indexed columns. You can avoid the occurrence of indexes and rewrite queries and improve query performance. Specifically, when Usingtemporary appears in EXPLAIN output, it means that MySQL needs to create temporary tables to handle queries. This usually occurs when: 1) deduplication or grouping when using DISTINCT or GROUPBY; 2) sort when ORDERBY contains non-index columns; 3) use complex subquery or join operations. Optimization methods include: 1) ORDERBY and GROUPB


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Linux new version
SublimeText3 Linux latest version

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.