search
HomeDatabaseMysql TutorialMySql管理工具phpMyadmin创建数据库和设置用户权限详细图文教程_MySQL

phpmyadmin

bitsCN.com

phpMyAdmin是一款不错的管理mysql的web系统,利用phpMyAdmin创建数据库,创建用户,设置用户权限,备份数据,恢复数据都很方便。

在管理数据库方面,安全非常重要,最小的的权限,最大的安全。下面讲下如何通过phpMyAdmin来设置不同数据库的访问用户权限。

第一步:管理员权限账号登陆phpMyAdmin,一般用root登录

第二部:创建要设置权限的数据库(如果已经存在就不需要了)

填好数据库名称,数据库编码,我选择的是“中文-Chinese simplified”编码,点击创建,数据看就建好了

第三步:创建管理用户

创建完数据库后,点击新数据库sweiku.com,点击权限,出现一个新界面,再点击添加新用户,如上图

在这一步,特别注意,全局权限不需要选择,然后直接点执行。

第四步:设置用户权限

选择相应的权限,点击执行

上面权限意思可以对照下面翻译:

数据:

SELECT:允许读取数据。

INSERT:允许插入和替换数据。

UPDATA:允许更改数据。

DELETE:允许删除数据。

FILE:允许从文件中导入数据以及将数据导出至文件。

结构:

CREATE:允许创建新数据库和表。

ALTER:允许修改现有表的结构。

INDEX:允许创建和删除索引。

DROP:允许删除数据库和表。

CREATE TEMPORARY TABLES:允许创建暂时表。

CREATE VIEW:允许创建新的意见。

SHOW VIEW:显示创建的看法。

CREATE ROUTINE:允许创建存储过程。

ALTER ROUTINE:允许改变和下降存储过程。

EXECUTE:允许许执行存储过程。

管理:

GRANT:允许添加用户和权限,而不允许重新载入权限表。

SUPER:允许在达到最大允许数目时仍进行连接。

PROCESS:允许查看进程列表中的完整查询。

RELOAD:允许重新载入服务器设置并刷新服务器的缓存。

SHUTDOWN:允许关闭服务器。

SHOW DATABASES:允许访问完整的数据库列表。

LOCK TABLES:允许锁住当前线索的表。

REFERENCES:在此版本的 MySQL 中无效。

REPLICATION CLIENT:用户有权询问附属者/控制者在哪里。

REPLICATION SLAVE:回复附属者所需。

CREATE USER:允许创建,下降和重新命名的用户帐户。

 

至此,数据库的创建和权限设置就完成了,最后我们可以用新用户登陆phpMyAdmin

我们可以看到,用户可以关了相应权限的数据库,而其他数据库都不可见

bitsCN.com
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What Are the Limitations of Using Views in MySQL?What Are the Limitations of Using Views in MySQL?May 14, 2025 am 12:10 AM

MySQLviewshavelimitations:1)Theydon'tsupportallSQLoperations,restrictingdatamanipulationthroughviewswithjoinsorsubqueries.2)Theycanimpactperformance,especiallywithcomplexqueriesorlargedatasets.3)Viewsdon'tstoredata,potentiallyleadingtooutdatedinforma

Securing Your MySQL Database: Adding Users and Granting PrivilegesSecuring Your MySQL Database: Adding Users and Granting PrivilegesMay 14, 2025 am 12:09 AM

ProperusermanagementinMySQLiscrucialforenhancingsecurityandensuringefficientdatabaseoperation.1)UseCREATEUSERtoaddusers,specifyingconnectionsourcewith@'localhost'or@'%'.2)GrantspecificprivilegeswithGRANT,usingleastprivilegeprincipletominimizerisks.3)

What Factors Influence the Number of Triggers I Can Use in MySQL?What Factors Influence the Number of Triggers I Can Use in MySQL?May 14, 2025 am 12:08 AM

MySQLdoesn'timposeahardlimitontriggers,butpracticalfactorsdeterminetheireffectiveuse:1)Serverconfigurationimpactstriggermanagement;2)Complextriggersincreasesystemload;3)Largertablesslowtriggerperformance;4)Highconcurrencycancausetriggercontention;5)M

MySQL: Is it safe to store BLOB?MySQL: Is it safe to store BLOB?May 14, 2025 am 12:07 AM

Yes,it'ssafetostoreBLOBdatainMySQL,butconsiderthesefactors:1)StorageSpace:BLOBscanconsumesignificantspace,potentiallyincreasingcostsandslowingperformance.2)Performance:LargerrowsizesduetoBLOBsmayslowdownqueries.3)BackupandRecovery:Theseprocessescanbe

MySQL: Adding a user through a PHP web interfaceMySQL: Adding a user through a PHP web interfaceMay 14, 2025 am 12:04 AM

Adding MySQL users through the PHP web interface can use MySQLi extensions. The steps are as follows: 1. Connect to the MySQL database and use the MySQLi extension. 2. Create a user, use the CREATEUSER statement, and use the PASSWORD() function to encrypt the password. 3. Prevent SQL injection and use the mysqli_real_escape_string() function to process user input. 4. Assign permissions to new users and use the GRANT statement.

MySQL: BLOB and other no-sql storage, what are the differences?MySQL: BLOB and other no-sql storage, what are the differences?May 13, 2025 am 12:14 AM

MySQL'sBLOBissuitableforstoringbinarydatawithinarelationaldatabase,whileNoSQLoptionslikeMongoDB,Redis,andCassandraofferflexible,scalablesolutionsforunstructureddata.BLOBissimplerbutcanslowdownperformancewithlargedata;NoSQLprovidesbetterscalabilityand

MySQL Add User: Syntax, Options, and Security Best PracticesMySQL Add User: Syntax, Options, and Security Best PracticesMay 13, 2025 am 12:12 AM

ToaddauserinMySQL,use:CREATEUSER'username'@'host'IDENTIFIEDBY'password';Here'showtodoitsecurely:1)Choosethehostcarefullytocontrolaccess.2)SetresourcelimitswithoptionslikeMAX_QUERIES_PER_HOUR.3)Usestrong,uniquepasswords.4)EnforceSSL/TLSconnectionswith

MySQL: How to avoid String Data Types common mistakes?MySQL: How to avoid String Data Types common mistakes?May 13, 2025 am 12:09 AM

ToavoidcommonmistakeswithstringdatatypesinMySQL,understandstringtypenuances,choosetherighttype,andmanageencodingandcollationsettingseffectively.1)UseCHARforfixed-lengthstrings,VARCHARforvariable-length,andTEXT/BLOBforlargerdata.2)Setcorrectcharacters

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor