You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*Percona Server for MySQL* has implemented variable which can be used for enforcing the
4
-
use of a specific storage engine.
3
+
Percona Server for MySQL lets you enforce a specific storage engine for table creation. You do this with the [`enforce_storage_engine`](#enforce_storage_engine) variable.
5
4
6
-
When this variable is specified and a user tries to create a table using an
7
-
explicit storage engine that is not the specified enforced engine, the user
8
-
will get either an error if the `NO_ENGINE_SUBSTITUTION` SQL mode is enabled
9
-
or a warning if `NO_ENGINE_SUBSTITUTION` is disabled and the table
10
-
will be created anyway using the enforced engine (this is consistent with the
11
-
default *MySQL* way of creating the default storage engine if other engines
12
-
are not available unless `NO_ENGINE_SUBSTITUTION` is set).
5
+
## Benefits
13
6
14
-
In case user tries to enable [enforce_storage_engine](#enforce_storage_engine) with engine that isn’t available, system will not start.
7
+
The option allows you to enforce a specific storage engine for all table creations. This ability can be useful for:
15
8
16
-
!!! note
17
9
18
-
If you’re using enforce_storage_engine, you must either disable
19
-
it before doing `mysql_upgrade` or perform `mysql_upgrade` with server
20
-
started with `--skip-grants-tables`.
10
+
When `enforce_storage_engine` is set, Percona Server behaves as follows:
| Optimizing performance | Improves performance when an application is designed for a specific storage engine. |
17
+
| Compliance | Enforces a specific storage engine to meet regulatory or compliance requirements. |
23
18
24
-
*[Percona Server for MySQL 8.0.13-4](release-notes/Percona-Server-8.0.13-4.md#id1): The feature was ported from *Percona Server for MySQL* 5.7.
19
+
## Version information
20
+
21
+
*[Percona Server for MySQL 8.0.13-4](release-notes/Percona-Server-8.0.13-4.md#id1): The feature was ported from Percona Server for MySQL 5.7.
25
22
26
23
## System variables
27
24
@@ -36,12 +33,85 @@ In case user tries to enable [enforce_storage_engine](#enforce_storage_engine) w
36
33
| Data type | String |
37
34
| Default value | NULL |
38
35
39
-
This variable is not case sensitive.
36
+
This variable is not case-sensitive.
37
+
38
+
When `enforce_storage_engine` is set, the server enforces specfic rules for table creation.
39
+
40
+
If [`NO_ENGINE_SUBSTITUTION`](https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sqlmode_no_engine_substitution) SQL mode is enabled.
41
+
42
+
The server enforces strict storage engine rules during table creation. If you specify a storage engine that differs from the enforced engine, the server will do the following:
43
+
44
+
* Generates an error
45
+
46
+
* Does not create a table
47
+
48
+
If [`NO_ENGINE_SUBSTITUTION`](https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sqlmode_no_engine_substitution) SQL mode is disabled.
49
+
50
+
When you specify a storage engine that differs from the enforced engine, the server does the following:
51
+
52
+
* Creates the table using the enforced storage engine
53
+
54
+
* Issues a warning about engine substitution
55
+
56
+
You can check the current SQL mode settings:
57
+
58
+
```{.bash data-prompt="mysql>"}
59
+
mysql> SELECT @sql_mode;
60
+
```
61
+
62
+
The server requires a valid storage engine setting for `enforce_storage_engine`. If the storage engine is not available, the server does not start.
63
+
64
+
You can check the available storage engines with the following command:
0 commit comments