Skip to content

Commit 724afbc

Browse files
authored
Merge pull request #3092 from Scalingo/chore/databases/mysql
Split MySQL pages to follow what's been done for PG
2 parents 6b2407c + 94998cf commit 724afbc

12 files changed

+684
-475
lines changed

redirections.yml

+3
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,9 @@
605605
-
606606
old: "/databases/mysql/workbench"
607607
new: "/databases/mysql/accessing"
608+
-
609+
old: "/databases/mysql/managing"
610+
new: "/databases/mysql/overview"
608611
-
609612
old: "/databases/postgresql/managing"
610613
new: "/databases/postgresql/overview"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
---
2+
title: Changing Plan
3+
nav: Changing Plan
4+
modified_at: 2025-03-31 12:00:00
5+
tags: databases mysql addon
6+
index: 7
7+
---
8+
9+
At Scalingo, all databases addons plans are identified using a name made of two
10+
or three parts separated by a dash (-). This name is made of:
11+
12+
1. a database ***type*** : `mysql`
13+
2. a ***class*** : either `sandbox`, `starter` or `business` (learn more about
14+
[classes]({% post_url databases/2000-01-01-overview %}#database-plans))
15+
3. a ***size*** : specifying the amount of RAM available with the plan, in MB
16+
(only for starter and business classes).
17+
18+
You can change your Scalingo for MySQL® addon plan whenever you want. The
19+
operation is launched instantly, no manual input is required.
20+
21+
The impact on your application and the downtime vary depending on several
22+
factors such as the current plan being used and the one you wish to change for
23+
(see below for further information).
24+
25+
{% warning %}
26+
While switching to a more powerful plan is rather safe, you should take extra
27+
care when changing for a less powerful plan: please make sure the new plan can
28+
handle all your data and fits your application workload.
29+
{% endwarning %}
30+
31+
32+
## Understanding the Plan Change Process
33+
34+
### From Starter to Starter
35+
36+
When changing the size of a Starter plan, the platform reboots the existing
37+
instance with the new size. This leads to a small service interruption
38+
during which the database is not available. This shouldn't exceed a few seconds
39+
though.
40+
41+
| From (class) | To (class) | To (size) | Downtime | Duration |
42+
| ------------ | ---------- | --------- | -------- | ------------ |
43+
| Starter | Starter | Any | **Yes** | 2-10 seconds |
44+
45+
### From Starter to Business
46+
47+
When changing for a Business plan, the platform starts additional instances
48+
with the targeted size. If necessary, it then reboots the previously existing
49+
instance with the targeted size. There should be no downtime at all, thanks to
50+
the failover mechanism included with the Business plan.
51+
52+
| From (class) | To (class) | To (size) | Downtime | Duration |
53+
| ------------ | ---------- | --------- | -------- | ------------ |
54+
| Starter | Business | Any | **No** | Zero |
55+
56+
### From Business to Starter
57+
58+
When changing for a lower class, the platform first powers the surplus
59+
instances off. When necessary, the remaining instance is rebooted with the
60+
targeted new size. This can lead to a small service interruption during which
61+
the database is not available. This shouldn't exceed a few seconds though.
62+
63+
| From (class) | To (class) | To (size) | Downtime | Duration |
64+
| ------------ | ---------- | --------- | -------- | ------------ |
65+
| Business | Starter | Same | **No** | Zero |
66+
| Business | Starter | Larger | **Yes** | 2-10 seconds |
67+
| Business | Starter | Smaller | **Yes** | 2-10 seconds |
68+
69+
### From Business to Business
70+
71+
When changing the size of a Business plan, the platform reboots the instances
72+
with the targeted new size one by one. There's no downtime during this
73+
operation, thanks to the high availability mechanism included in the Business
74+
plan.
75+
76+
| From (class) | To (class) | To (size) | Downtime | Duration |
77+
| ------------ | ---------- | --------- | -------- | ------------ |
78+
| Business | Business | Any | **No** | Zero |
79+
80+
81+
## Using the Dashboard
82+
83+
1. From your web browser, open your [dashboard](https://dashboard.scalingo.com/apps)
84+
2. Click on the application for which you want to scale the Scalingo for
85+
MySQL® addon
86+
3. Click on the **Resources** tab
87+
4. Locate the **Addons** block and click on the **"…"** button
88+
5. From the dropdown menu, select **Change plan**
89+
6. Select the new plan
90+
7. Click the **Finish** button
91+
8. Validate by clicking the **Confirm plan change** button
92+
93+
94+
## Using the Database Dashboard
95+
96+
1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-mysql-dashboard)
97+
2. Click the **Settings** tab
98+
3. In **General**, locate the **Database Plan** block
99+
4. In this block, click the **Change plan** button
100+
5. Select the new plan
101+
6. Click the **Finish** button
102+
7. Validate by clicking the **Confirm plan change** button
103+
104+
105+
## Using the Command Line
106+
107+
1. Make sure you have correctly [setup the Scalingo command line tool]({% post_url platform/cli/2000-01-01-start %})
108+
2. From the command line, list the plans available for `mysql`:
109+
```bash
110+
scalingo addons-plans mysql
111+
```
112+
The output should look like this:
113+
```text
114+
+-----------------------+---------------+
115+
| ID | NAME |
116+
+-----------------------+---------------+
117+
| mysql-sandbox | Sandbox |
118+
| mysql-starter-512 | Starter 512M |
119+
| mysql-starter-1024 | Starter 1G |
120+
...
121+
```
122+
3. Locate the `ID` corresponding to the plan you want to scale to (for example
123+
`mysql-business-1024`)
124+
4. Change plan using the `addons-upgrade` sub-command:
125+
```bash
126+
scalingo --app my-app addons-upgrade mysql <plan_ID>
127+
```
128+
The output should look like this:
129+
```text
130+
-----> Addon ad-d0aa540a-5ed2-41f8-8bbe-91e3aff6623b has been upgraded
131+
Message from addon provider: Database plan is being changed
132+
```
133+
134+
135+
## Using the Terraform Provider
136+
137+
1. Update the `plan` property of the corresponding Resource block in your
138+
Terraform file to scale the addon:
139+
```tf
140+
resource "scalingo_addon" "my-db" {
141+
provider_id = "mysql"
142+
plan = "mysql-business-1024"
143+
app = "${scalingo_app.my-app.id}"
144+
}
145+
```
146+
In this example, we switch the `my-db` resource attached to the `my-app`
147+
application to a MySQL® Business 1024 addon.

src/_posts/databases/mysql/2000-01-01-getting-started.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ tasks such as:
8383

8484
- [Monitoring the database]({% post_url databases/mysql/2000-01-01-monitoring %})
8585
through logs, metrics and statistics
86-
- [Upgrading the database]({% post_url databases/mysql/2000-01-01-managing %}#upgrading)
86+
- [Upgrading the database]({% post_url databases/mysql/2000-01-01-upgrading %})
8787
engine version
88-
- [Managing database users]({% post_url databases/mysql/2000-01-01-managing %}#managing-users)
89-
- [Managing databases]({% post_url databases/mysql/2000-01-01-managing %}#using-multiple-databases)
88+
- [Managing database users]({% post_url databases/mysql/2000-01-01-managing-users %})
89+
- [Managing databases]({% post_url databases/mysql/2000-01-01-using-multiple-databases %})
9090
- [Managing backups]({% post_url databases/mysql/2000-01-01-backing-up %})
9191

9292
You can access the database dashboard via the application dashboard:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
---
2+
title: Managing Users of Your Scalingo for MySQL® Addon
3+
nav: Managing Users
4+
modified_at: 2025-03-31 12:00:00
5+
tags: databases mysql addon
6+
index: 5
7+
---
8+
9+
Each Scalingo for MySQL® addon comes with a [default database user](#understanding-protected-user).
10+
You can [create](#creating-a-new-user) as many additional users as needed,
11+
grant them with the appropriate permissions, and you can [delete](#deleting-a-user)
12+
them once they are not required anymore.
13+
14+
15+
## Listing Existing Users
16+
17+
### Understanding Protected User
18+
19+
When provisioning a new Scalingo for MySQL® addon, the platform creates a
20+
default user with a random name and password. It also grants this default user
21+
read and write permissions on the database, using the following queries:
22+
23+
```sql
24+
GRANT ALL PRIVILEGES ON <database>.* TO '<username>'@'%%'
25+
```
26+
27+
{% note %}
28+
This default user is ***protected*** and thus:
29+
- can't be renamed, nor removed,
30+
- its password can't be updated
31+
{% endnote %}
32+
33+
### Using the Database Dashboard
34+
35+
1. From your web browser, open your [database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-mysql-dashboard)
36+
2. Click the **Settings** tab
37+
3. In the **Settings** submenu, select **Users**
38+
4. The list of available users is displayed under the **User Management**
39+
section
40+
41+
### Using the Command Line
42+
43+
1. Make sure you have correctly [setup the Scalingo command line tool]({% post_url platform/cli/2000-01-01-start %})
44+
2. From the command line, run the following command to list the users:
45+
```bash
46+
scalingo --app my-app --addon mysql database-users-list
47+
```
48+
The output should look like this:
49+
```text
50+
+----------------+-----------+-----------+
51+
| USERNAME | READ-ONLY | PROTECTED |
52+
+----------------+-----------+-----------+
53+
| my_app_4553 | false | true |
54+
| my_app_4553_rw | false | false |
55+
| my_app_4553_ro | true | false |
56+
+----------------+-----------+-----------+
57+
```
58+
In this example, we can see that the database has 3 users available. One has
59+
been created along with the addon and is protected, which means it can't be
60+
removed. Among the two others, one can only read data from the database.
61+
62+
63+
## Creating a New User
64+
65+
{% note %}
66+
The following restrictions apply when creating a new user, regardless of the
67+
method you use:
68+
69+
- Username **must**:
70+
- Start with a letter
71+
- Be between 6 and 16 characters long
72+
- Contain only alphanumerical characters and underscores (`_`)
73+
- Password **must**:
74+
- Be between 24 and 64 characters long.
75+
- Not contain the character `"` or `'`
76+
{% endnote %}
77+
78+
### Using the Database Dashboard
79+
80+
1. From your web browser, open your [database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-mysql-dashboard)
81+
2. Click the **Settings** tab
82+
3. In the **Settings** submenu, select **Users**
83+
4. Click the **Add a user** button
84+
5. Fill the **Add a new user** form:
85+
- Fill a username
86+
- To grant write abilities to this user, make sure to check the **Write
87+
(optional)** checkbox
88+
6. Validate by clicking the **Add this user** button
89+
7. A secure password is generated automatically and shown in a popup window
90+
after the user creation. **You will be able to view and copy it only once**.
91+
92+
### Using the Command Line
93+
94+
1. Make sure you have correctly [setup the Scalingo command line tool]({% post_url platform/cli/2000-01-01-start %})
95+
2. From the command line, run the following command to create a new user:
96+
```bash
97+
scalingo --app my-app --addon mysql database-users-create <username>
98+
```
99+
Optionally, if you want to restrict this user to read only abilities, use
100+
the `--read-only` flag:
101+
```bash
102+
scalingo --app my-app --addon mysql database-users-create --read-only <username>
103+
```
104+
3. Set the user password:
105+
- Either chose a password and confirm it
106+
- Or let the platform generate a password by leaving the field empty
107+
108+
The output should look like this:
109+
- If you set a password:
110+
```text
111+
User "my_user" created.
112+
```
113+
- If you let the platform generate a password:
114+
```text
115+
User "my_user" created with password "YANs3y07m5_KJC2MSDGebh8tx1lliFWh2Yb239zVqGQvbElWDjIN7QWspVH92Ul8".
116+
```
117+
118+
## Updating a User Password
119+
120+
{% note %}
121+
- Setting a user password to a **specific value** can only be done via the
122+
command line.
123+
- Please get in touch with our Support Team to update a
124+
[protected user](#understanding-protected-user) password.
125+
{% endnote %}
126+
127+
### Using the Database Dashboard
128+
129+
1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-mysql-dashboard)
130+
2. Click the **Settings** tab
131+
3. In the **Settings** submenu, select **Users**
132+
4. Locate the user you want the password to be updated
133+
5. Click the **"&#8230;"** button next to the user
134+
6. From the popup menu, select **Reset password**
135+
7. In the popup window, confirm the reset by typing the name of the user
136+
8. Validate by clicking the **Confirm** button
137+
9. A secure password is generated automatically and shown in a popup window
138+
after the password reset. **You will be able to view and copy it only
139+
once**.
140+
141+
### Using the Command Line
142+
143+
1. Make sure you have correctly [setup the Scalingo command line tool]({% post_url platform/cli/2000-01-01-start %})
144+
2. Update the user password with the following command:
145+
```bash
146+
scalingo --app my-app --addon mysql database-users-update-password <username>
147+
```
148+
3. An interactive prompt asks you for a password you want to attribute to your user:
149+
- Either choose a password and confirm it
150+
- Or let the platform generate a password by leaving the field empty
151+
The output should look like this:
152+
- If you set a password:
153+
```text
154+
User "my_user" created.
155+
```
156+
- If you let the platform generate a password:
157+
```text
158+
User "my_user" created with password "YANs3y07m5_KJC2MSDGebh8tx1lliFWh2Yb239zVqGQvbElWDjIN7QWspVH92Ul8".
159+
```
160+
161+
162+
## Deleting a User
163+
164+
### Using the Database Dashboard
165+
166+
1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-mysql-dashboard)
167+
2. Click the **Settings** tab
168+
3. In the **Settings** submenu, select **Users**
169+
4. Locate the user you want to remove
170+
5. Click the **"&#8230;"** button next to the user
171+
6. From the popup menu, select **Delete user**
172+
7. In the popup window, confirm the deletion by typing the name of the user
173+
8. Validate by clicking the **Confirm** button
174+
175+
### Using the Command Line
176+
177+
1. Make sure you have correctly [setup the Scalingo command line tool]({% post_url platform/cli/2000-01-01-start %})
178+
2. Remove the user with the following command:
179+
```bash
180+
scalingo --app my-app --addon mysql database-users-delete <username>
181+
```

0 commit comments

Comments
 (0)