怎么新建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)