怎么新建MYSQL用户(mysql怎么新建一个用户)

怎么新建MysqL用户(MysqL怎么新建一个用户)

#头条创作挑战赛#

怎么新建MysqL用户,并限制他MysqL空间!


新建用户时,下面的权限一个也不要选(切记),只填入主机名,用户名,密码,就可以。


然后点重启 MysqL


建立一个数据库


然后找到新建的那个用户,点Grants ,进去后,选择刚建的那个数据库


授予下面的权限:


Select,Insert,Update,Delete,Create,Drop,Alter


再点重启 MysqL !


用户就建完了。

一个国外用户的解答:

There is no out of the Box solution. But you can do the following:

Get the data_length and index_length for the tables the user owns with show table status (This is the amount of space the data files use in the file system)

Sum up these numbers for all databases

If the limit is reached,remove for example INSERT privileges for that user,so he can not insert new data anymore.

But keep in mind that removing data from an InnoDB tables will not free up space in the file system. So if your user reached the limit,he can not do anything against it. (Except dumping all InnoDB tables,dropping them and reimport them)

相关文章

预装win11的电脑也可以安装win7系统,本文详细介绍了具体操作...
Win11和Win7双系统可以兼顾新系统的功能和旧系统的兼容性,但...
Win7无法直接升级Win11,需要全新安装。升级前请备份重要数据...
这篇win7改win11详细教程,带你一步步完成系统升级,包括备份...
Win7和Win11跑分对比结果出人意料,Win7在某些场景下性能表现...
Win7之家显卡天梯图为您提供最全面的显卡性能对比和选择指南...