T
T
T3R3AND2020-05-18 16:40:53
linux
T3R3AND, 2020-05-18 16:40:53

Limit database weight in mysql?

Hello! This is probably a question of interest to everyone, but how to make restrictions on the weight of the database for the user? I searched, I did not find the answer, I decided to ask.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
D
Dmitry Kim, 2020-05-18
@kimono

At the file system level, you can check the size, and upon reaching a certain threshold, issue a notification to the user and restrict certain operations.

G
gimcnuk, 2020-05-18
@gimcnuk

SELECT SUM(DATA_LENGTH + INDEX_LENGTH) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='users_db'

D
Dmitry Shitskov, 2020-05-18
@Zarom

mysql does not limit the size of the user's database.
The way out is to limit the disk space allocated to a particular database.
For example, a database users_db will be created for a user . You need to create a directory in /var/lib/mysql/users_db and mount the file system of the required size there.
If the file system is xfs, then you can simply install quota directly on the directory with the user base.

A
Alexey Dmitriev, 2020-05-18
@SignFinder

file system of the required size is not necessary - you can simply set a quota.

S
Sanes, 2020-05-18
@Sanes

Best to just check. For example, throughdu

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question