Skip to content

Split MySQL pages to follow what's been done for PG #3092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions redirections.yml
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,9 @@
-
old: "/databases/mysql/workbench"
new: "/databases/mysql/accessing"
-
old: "/databases/mysql/managing"
new: "/databases/mysql/overview"
-
old: "/databases/postgresql/managing"
new: "/databases/postgresql/overview"
Expand Down
147 changes: 147 additions & 0 deletions src/_posts/databases/mysql/2000-01-01-changing-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
---
title: Changing Plan
nav: Changing Plan
modified_at: 2025-03-31 12:00:00
tags: databases mysql addon
index: 7
---

At Scalingo, all databases addons plans are identified using a name made of two
or three parts separated by a dash (-). This name is made of:

1. a database ***type*** : `mysql`
2. a ***class*** : either `sandbox`, `starter` or `business` (learn more about
[classes]({% post_url databases/2000-01-01-overview %}#database-plans))
3. a ***size*** : specifying the amount of RAM available with the plan, in MB
(only for starter and business classes).

You can change your Scalingo for MySQL® addon plan whenever you want. The
operation is launched instantly, no manual input is required.

The impact on your application and the downtime vary depending on several
factors such as the current plan being used and the one you wish to change for
(see below for further information).

{% warning %}
While switching to a more powerful plan is rather safe, you should take extra
care when changing for a less powerful plan: please make sure the new plan can
handle all your data and fits your application workload.
{% endwarning %}


## Understanding the Plan Change Process

### From Starter to Starter

When changing the size of a Starter plan, the platform reboots the existing
instance with the new size. This leads to a small service interruption
during which the database is not available. This shouldn't exceed a few seconds
though.

| From (class) | To (class) | To (size) | Downtime | Duration |
| ------------ | ---------- | --------- | -------- | ------------ |
| Starter | Starter | Any | **Yes** | 2-10 seconds |

### From Starter to Business

When changing for a Business plan, the platform starts additional instances
with the targeted size. If necessary, it then reboots the previously existing
instance with the targeted size. There should be no downtime at all, thanks to
the failover mechanism included with the Business plan.

| From (class) | To (class) | To (size) | Downtime | Duration |
| ------------ | ---------- | --------- | -------- | ------------ |
| Starter | Business | Any | **No** | Zero |

### From Business to Starter

When changing for a lower class, the platform first powers the surplus
instances off. When necessary, the remaining instance is rebooted with the
targeted new size. This can lead to a small service interruption during which
the database is not available. This shouldn't exceed a few seconds though.

| From (class) | To (class) | To (size) | Downtime | Duration |
| ------------ | ---------- | --------- | -------- | ------------ |
| Business | Starter | Same | **No** | Zero |
| Business | Starter | Larger | **Yes** | 2-10 seconds |
| Business | Starter | Smaller | **Yes** | 2-10 seconds |

### From Business to Business

When changing the size of a Business plan, the platform reboots the instances
with the targeted new size one by one. There's no downtime during this
operation, thanks to the high availability mechanism included in the Business
plan.

| From (class) | To (class) | To (size) | Downtime | Duration |
| ------------ | ---------- | --------- | -------- | ------------ |
| Business | Business | Any | **No** | Zero |


## Using the Dashboard

1. From your web browser, open your [dashboard](https://dashboard.scalingo.com/apps)
2. Click on the application for which you want to scale the Scalingo for
MySQL® addon
3. Click on the **Resources** tab
4. Locate the **Addons** block and click on the **"…"** button
5. From the dropdown menu, select **Change plan**
6. Select the new plan
7. Click the **Finish** button
8. Validate by clicking the **Confirm plan change** button


## Using the Database Dashboard

1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-mysql-dashboard)
2. Click the **Settings** tab
3. In **General**, locate the **Database Plan** block
4. In this block, click the **Change plan** button
5. Select the new plan
6. Click the **Finish** button
7. Validate by clicking the **Confirm plan change** button


## Using the Command Line

1. Make sure you have correctly [setup the Scalingo command line tool]({% post_url platform/cli/2000-01-01-start %})
2. From the command line, list the plans available for `mysql`:
```bash
scalingo addons-plans mysql
```
The output should look like this:
```text
+-----------------------+---------------+
| ID | NAME |
+-----------------------+---------------+
| mysql-sandbox | Sandbox |
| mysql-starter-512 | Starter 512M |
| mysql-starter-1024 | Starter 1G |
...
```
3. Locate the `ID` corresponding to the plan you want to scale to (for example
`mysql-business-1024`)
4. Change plan using the `addons-upgrade` sub-command:
```bash
scalingo --app my-app addons-upgrade mysql <plan_ID>
```
The output should look like this:
```text
-----> Addon ad-d0aa540a-5ed2-41f8-8bbe-91e3aff6623b has been upgraded
Message from addon provider: Database plan is being changed
```


## Using the Terraform Provider

1. Update the `plan` property of the corresponding Resource block in your
Terraform file to scale the addon:
```tf
resource "scalingo_addon" "my-db" {
provider_id = "mysql"
plan = "mysql-business-1024"
app = "${scalingo_app.my-app.id}"
}
```
In this example, we switch the `my-db` resource attached to the `my-app`
application to a MySQL® Business 1024 addon.
6 changes: 3 additions & 3 deletions src/_posts/databases/mysql/2000-01-01-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ tasks such as:

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

You can access the database dashboard via the application dashboard:
Expand Down
181 changes: 181 additions & 0 deletions src/_posts/databases/mysql/2000-01-01-managing-users.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
---
title: Managing Users of Your Scalingo for MySQL® Addon
nav: Managing Users
modified_at: 2025-03-31 12:00:00
tags: databases mysql addon
index: 5
---

Each Scalingo for MySQL® addon comes with a [default database user](#understanding-protected-user).
You can [create](#creating-a-new-user) as many additional users as needed,
grant them with the appropriate permissions, and you can [delete](#deleting-a-user)
them once they are not required anymore.


## Listing Existing Users

### Understanding Protected User

When provisioning a new Scalingo for MySQL® addon, the platform creates a
default user with a random name and password. It also grants this default user
read and write permissions on the database, using the following queries:

```sql
GRANT ALL PRIVILEGES ON <database>.* TO '<username>'@'%%'
```

{% note %}
This default user is ***protected*** and thus:
- can't be renamed, nor removed,
- its password can't be updated
{% endnote %}

### Using the Database Dashboard

1. From your web browser, open your [database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-mysql-dashboard)
2. Click the **Settings** tab
3. In the **Settings** submenu, select **Users**
4. The list of available users is displayed under the **User Management**
section

### Using the Command Line

1. Make sure you have correctly [setup the Scalingo command line tool]({% post_url platform/cli/2000-01-01-start %})
2. From the command line, run the following command to list the users:
```bash
scalingo --app my-app --addon mysql database-users-list
```
The output should look like this:
```text
+----------------+-----------+-----------+
| USERNAME | READ-ONLY | PROTECTED |
+----------------+-----------+-----------+
| my_app_4553 | false | true |
| my_app_4553_rw | false | false |
| my_app_4553_ro | true | false |
+----------------+-----------+-----------+
```
In this example, we can see that the database has 3 users available. One has
been created along with the addon and is protected, which means it can't be
removed. Among the two others, one can only read data from the database.


## Creating a New User

{% note %}
The following restrictions apply when creating a new user, regardless of the
method you use:

- Username **must**:
- Start with a letter
- Be between 6 and 16 characters long
- Contain only alphanumerical characters and underscores (`_`)
- Password **must**:
- Be between 24 and 64 characters long.
- Not contain the character `"` or `'`
{% endnote %}

### Using the Database Dashboard

1. From your web browser, open your [database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-mysql-dashboard)
2. Click the **Settings** tab
3. In the **Settings** submenu, select **Users**
4. Click the **Add a user** button
5. Fill the **Add a new user** form:
- Fill a username
- To grant write abilities to this user, make sure to check the **Write
(optional)** checkbox
6. Validate by clicking the **Add this user** button
7. A secure password is generated automatically and shown in a popup window
after the user creation. **You will be able to view and copy it only once**.

### Using the Command Line

1. Make sure you have correctly [setup the Scalingo command line tool]({% post_url platform/cli/2000-01-01-start %})
2. From the command line, run the following command to create a new user:
```bash
scalingo --app my-app --addon mysql database-users-create <username>
```
Optionally, if you want to restrict this user to read only abilities, use
the `--read-only` flag:
```bash
scalingo --app my-app --addon mysql database-users-create --read-only <username>
```
3. Set the user password:
- Either chose a password and confirm it
- Or let the platform generate a password by leaving the field empty

The output should look like this:
- If you set a password:
```text
User "my_user" created.
```
- If you let the platform generate a password:
```text
User "my_user" created with password "YANs3y07m5_KJC2MSDGebh8tx1lliFWh2Yb239zVqGQvbElWDjIN7QWspVH92Ul8".
```

## Updating a User Password

{% note %}
- Setting a user password to a **specific value** can only be done via the
command line.
- Please get in touch with our Support Team to update a
[protected user](#understanding-protected-user) password.
{% endnote %}

### Using the Database Dashboard

1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-mysql-dashboard)
2. Click the **Settings** tab
3. In the **Settings** submenu, select **Users**
4. Locate the user you want the password to be updated
5. Click the **"&#8230;"** button next to the user
6. From the popup menu, select **Reset password**
7. In the popup window, confirm the reset by typing the name of the user
8. Validate by clicking the **Confirm** button
9. A secure password is generated automatically and shown in a popup window
after the password reset. **You will be able to view and copy it only
once**.

### Using the Command Line

1. Make sure you have correctly [setup the Scalingo command line tool]({% post_url platform/cli/2000-01-01-start %})
2. Update the user password with the following command:
```bash
scalingo --app my-app --addon mysql database-users-update-password <username>
```
3. An interactive prompt asks you for a password you want to attribute to your user:
- Either choose a password and confirm it
- Or let the platform generate a password by leaving the field empty
The output should look like this:
- If you set a password:
```text
User "my_user" created.
```
- If you let the platform generate a password:
```text
User "my_user" created with password "YANs3y07m5_KJC2MSDGebh8tx1lliFWh2Yb239zVqGQvbElWDjIN7QWspVH92Ul8".
```


## Deleting a User

### Using the Database Dashboard

1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-mysql-dashboard)
2. Click the **Settings** tab
3. In the **Settings** submenu, select **Users**
4. Locate the user you want to remove
5. Click the **"&#8230;"** button next to the user
6. From the popup menu, select **Delete user**
7. In the popup window, confirm the deletion by typing the name of the user
8. Validate by clicking the **Confirm** button

### Using the Command Line

1. Make sure you have correctly [setup the Scalingo command line tool]({% post_url platform/cli/2000-01-01-start %})
2. Remove the user with the following command:
```bash
scalingo --app my-app --addon mysql database-users-delete <username>
```
Loading