Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 4a7afa2

Browse files
authored
Merge pull request magento-commerce/devdocs#2760 from magento-devdocs/hg-mc8423-dbupdate
MCLOUD-8423 update mysql configuration content
2 parents 9a77933 + 20c6d70 commit 4a7afa2

File tree

1 file changed

+33
-11
lines changed

1 file changed

+33
-11
lines changed

src/cloud/project/services-mysql.md

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ The `mysql` service provides persistent data storage based on [MariaDB](https://
1313
{% include install/maria-db.md %}
1414

1515
{:.bs-callout-warning}
16-
Be careful when upgrading MariaDB from version 10.1 to 10.2.
17-
MariaDB 10.1 is the last version that supports XtraDB as the storage engine. Version 10.2 uses InnoDB for the storage engine. Once you upgrade from 10.1 to 10.2, you cannot rollback the change. {{site.data.var.ee}} supports both storage engines; however, you must check extensions and other systems used by your project to make sure they are compatible with MariaDB 10.2. Read about this [backwards incompatible change](https://mariadb.com/kb/en/upgrading-from-mariadb-101-to-mariadb-102/#incompatible-changes-between-101-and-102).
16+
Be careful when upgrading MariaDB from version 10.1 to 10.2. MariaDB 10.1 is the last version that supports _XtraDB_ as the storage engine. MariaDB 10.2 uses _InnoDB_ for the storage engine. After you upgrade from 10.1 to 10.2, you cannot roll back the change. {{site.data.var.ee}} supports both storage engines; however, you must check extensions and other systems used by your project to make sure they are compatible with MariaDB 10.2. See [Incompatible Changes Between 10.1 and 10.2](https://mariadb.com/kb/en/upgrading-from-mariadb-101-to-mariadb-102/#incompatible-changes-between-101-and-102).
1817

1918
{% include cloud/service-config-integration-starter.md %}
2019

21-
## Enable MySQL
20+
{:.procedure}
21+
To enable MySQL:
2222

2323
1. Add the required name, type, and disk value (in MB) to the `.magento/services.yaml` file.
2424

@@ -41,21 +41,40 @@ MariaDB 10.1 is the last version that supports XtraDB as the storage engine. Ver
4141
1. Add, commit, and push your code changes.
4242

4343
```bash
44-
git add -A && git commit -m "Enable mysql service" && git push origin <branch-name>
44+
git add -A && git commit -m "Enable mysql service" && git push origin <branch-name>
4545
```
4646

4747
1. [Verify the service relationships]({{ site.baseurl }}/cloud/project/services.html#service-relationships).
4848

4949
{%include cloud/tip-change-installed-service-version.md%}
5050

51-
## Set up multiple database users
51+
## Configure MySQL database
5252

53-
Optionally, you can set up multiple databases and multiple users with different permissions.
53+
You have the following options when configuring the MySQL database:
5454

55-
An _endpoint_ is a set of credentials (or users) with specific privileges. By default, there is one endpoint named `mysql` that has administrator access to all defined databases. To set up multiple database users, you must define multiple endpoints in the services.yaml file and declare the relationships in the `.magento.app.yaml` file. For Pro Staging and Production environments, submit a Support ticket to request the additional user.
55+
- **`schemas`**—A schema defines a database. The default schema is the `main` database.
56+
- **`endpoints`**—Each endpoint represents a credential with specific privileges. The default endpoint is `mysql`, which has `admin` access to the `main` database.
57+
- **`properties`**—Properties are used to define additional database configurations.
5658

57-
{:.bs-callout-warning}
58-
You cannot use multiple _databases_ with {{site.data.var.ee}}, but you **can** create multiple endpoints to restrict access to the `main` database.
59+
The following is a basic example configuration in the `.magento/services.yaml` file:
60+
61+
```yaml
62+
mysql:
63+
type: mysql:10.4
64+
disk: 5120
65+
configuration:
66+
properties:
67+
optimizer_switch: "rowid_filter=off"
68+
optimizer_use_condition_selectivity: 1
69+
```
70+
71+
The `properties` in the above example modifies the default `optimizer` settings as [recommended in the Performance Best Practices guide]({{ site.baseurl }}{{ site.gdeurl }}/performance-best-practices/configuration.html#indexers).
72+
73+
### Set up multiple database users
74+
75+
Optionally, you can set up multiple users with different permissions for accessing the `main` database.
76+
77+
By default, there is one endpoint named `mysql` that has administrator access to the database. To set up multiple database users, you must define multiple endpoints in the `services.yaml` file and declare the relationships in the `.magento.app.yaml` file. For Pro Staging and Production environments, submit a Support ticket to request the additional user.
5978

6079
Use a nested array to define the endpoints for specific user access. Each endpoint can designate access to one or more schemas (databases) and different levels of permission on each.
6180

@@ -65,11 +84,11 @@ The valid permission levels are:
6584
- `rw`: SELECT queries and INSERT, UPDATE, and DELETE queries are allowed.
6685
- `admin`: All queries are allowed, including DDL queries (CREATE TABLE, DROP TABLE, and so on).
6786

68-
If no endpoints are defined, a single endpoint named `mysql` has `admin` access to the `main` database. For example:
87+
For example:
6988

7089
```yaml
7190
mysql:
72-
type: mysql:10.3
91+
type: mysql:10.4
7392
disk: 5120
7493
configuration:
7594
schemas:
@@ -85,6 +104,9 @@ mysql:
85104
importer:
86105
privileges:
87106
main: rw
107+
properties:
108+
optimizer_switch: "rowid_filter=off"
109+
optimizer_use_condition_selectivity: 1
88110
```
89111

90112
In the preceding example, the `admin` endpoint provides admin-level access to the `main` database, the `reporter` endpoint provides read-only access, and the `importer` endpoint provides read-write access, which means:

0 commit comments

Comments
 (0)