#头条创作挑战赛#怎么新建Mysql用户,并限制他MYSQL空间新建用户时,下面的权限一个也不要选(切记),只填入主机名,用户名,密码,就可以然后点重启 Mysql 建立一个空数据库然后找到新建的那个用户,点Grants ,进去后,选择刚建的那个数据库,授予下面的权限:Select,Insert ,Update,Delete,Create ,Drop,Alter再点重启 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:

  1. 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)
  2. Sum up these numbers for all databases
  3. 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)

,