微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐