From cefe2625b26e2162596fe9dcdb523eedc02d9b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20KUBLER?= Date: Thu, 27 Mar 2025 16:09:05 +0100 Subject: [PATCH 1/7] chore(mysql): split old 'Managing' page into multiple ones --- .../mysql/2000-01-01-changing-plan.md | 152 ++++++ .../mysql/2000-01-01-getting-started.md | 6 +- .../mysql/2000-01-01-managing-users.md | 179 +++++++ .../databases/mysql/2000-01-01-managing.md | 450 ------------------ .../mysql/2000-01-01-troubleshooting.md | 2 +- .../databases/mysql/2000-01-01-upgrading.md | 166 +++++++ .../2000-01-01-using-multiple-databases.md | 77 +++ .../2000-01-01-working-with-sql-modes.md | 50 ++ 8 files changed, 628 insertions(+), 454 deletions(-) create mode 100644 src/_posts/databases/mysql/2000-01-01-changing-plan.md create mode 100644 src/_posts/databases/mysql/2000-01-01-managing-users.md delete mode 100644 src/_posts/databases/mysql/2000-01-01-managing.md create mode 100644 src/_posts/databases/mysql/2000-01-01-upgrading.md create mode 100644 src/_posts/databases/mysql/2000-01-01-using-multiple-databases.md create mode 100644 src/_posts/databases/mysql/2000-01-01-working-with-sql-modes.md diff --git a/src/_posts/databases/mysql/2000-01-01-changing-plan.md b/src/_posts/databases/mysql/2000-01-01-changing-plan.md new file mode 100644 index 000000000..1db0e010b --- /dev/null +++ b/src/_posts/databases/mysql/2000-01-01-changing-plan.md @@ -0,0 +1,152 @@ +--- +title: Changing Plan +nav: Changing Plan +modified_at: 2025-03-13 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 + +{% note %} +Business Plans are only available starting with MySQL® 8.\ +Consider [upgrading to MySQL® 8](#upgrading-to-mysql-8) if you want to benefit +from high availability with MySQL®. +{% endnote %} + +### 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 nodes +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 nodes +off. When necessary, the remaining node 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 nodes 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 + ``` + 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. diff --git a/src/_posts/databases/mysql/2000-01-01-getting-started.md b/src/_posts/databases/mysql/2000-01-01-getting-started.md index e5fa0e5f5..19ca01954 100644 --- a/src/_posts/databases/mysql/2000-01-01-getting-started.md +++ b/src/_posts/databases/mysql/2000-01-01-getting-started.md @@ -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: diff --git a/src/_posts/databases/mysql/2000-01-01-managing-users.md b/src/_posts/databases/mysql/2000-01-01-managing-users.md new file mode 100644 index 000000000..5e6eb3a61 --- /dev/null +++ b/src/_posts/databases/mysql/2000-01-01-managing-users.md @@ -0,0 +1,179 @@ +--- +title: Managing Users of Your Scalingo for MySQL® Addon +nav: Managing Users +modified_at: 2025-03-13 12:00:00 +tags: databases mysql addon +index: 5 +--- + +Each Scalingo for MySQL addon comes with a [default database user](#understanding-protected-users). +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 .* TO ''@'%%' +``` + +{% 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-scalingo-for-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 + +The following restrictions apply when creating a new user, regardless of the +method you use: + +- Username: + - Must start with a letter + - Must be between 6 and 32 characters long + - Can only contain alphanumerical characters and underscores (`_`) +- Password: + - Must be between 24 and 64 characters long. + - Must not contain the character `"` or `'` + +### 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 + ``` + 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 + ``` +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-scalingo-for-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 **"…"** 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 + ``` +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-scalingo-for-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 **"…"** 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 + ``` diff --git a/src/_posts/databases/mysql/2000-01-01-managing.md b/src/_posts/databases/mysql/2000-01-01-managing.md deleted file mode 100644 index 24a05c0b1..000000000 --- a/src/_posts/databases/mysql/2000-01-01-managing.md +++ /dev/null @@ -1,450 +0,0 @@ ---- -title: Managing Your Scalingo for MySQL® Addon -nav: Managing -modified_at: 2024-10-24 12:00:00 -tags: databases mysql addon -index: 5 ---- - - -## Scaling (Changing Plan) - -You can change your database plan whenever you want. This operation happens -instantly, no manual input is required. When you change the plan, the instances -of your database are stopped and then restarted with the characteristics of the -chosen plan. According to the type of plan you are originally using, the impact -on your application differs: -- **Starter Plans**: Since these plans are not highly available, expect some - unavailability during which the scale operations are conducted. The duration - highly depends on the database size (from seconds to several hours). -- **Business Plans**: Thanks to high availability, only a failover occurs - during the operation. Current connections are stopped and the application has - to reconnect. It can be transparent or lead to a ~2-5 seconds interruption, - depending on the driver used by your application and its configuration. - -{% note %} - Business Plans are only available starting with MySQL® 8.\ - Consider [upgrading to MySQL® 8](#upgrading-to-mysql-8) if you want to - benefit from high availability with MySQL®. -{% endnote %} - -In both cases, once the operation is finished, the application is restarted to -ensure it creates new healthy connections to the database. - -{% warning %} -While upscaling (changing for a more powerful plan) is rather safe, you should -take extra care when downscaling: please make sure the new plan can handle all -your data and fits your application workload. -{% endwarning %} - -### 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-scalingo-for-mysql-dashboard) -2. Click the **Settings** tab -3. In **General**, select **Change plan** -4. Select the new plan -5. Click the **Finish** button -6. 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. List the addons attached to your application: - ```bash - scalingo --app my-app addons - ``` - The output should look like this: - ```text - +-------+-----------------------------------------+-------------------+---------+ - | ADDON | ID | PLAN | STATUS | - +-------+-----------------------------------------+-------------------+---------+ - | MySQL | ad-871546ad-943a-4929-9770-ec7c839d65f5 | mysql-starter-512 | running | - ... - ``` -5. Locate the `ID` corresponding to the addon you want to scale -6. Change plan using the `addons-upgrade` sub-command: - ```bash - scalingo --app my-app addons-upgrade - ``` - 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. -2. Run `terraform plan` and check if the result looks good -3. If so, run `terraform apply` - - -## Upgrading - -Upgrading your MySQL® addon consists in changing the database version for -a newer one. - -When the database vendor releases a new version of your database engine, we -take some time to study it and test it thoroughly before making it available. -Upgrading to this new version is still your choice. We don't do it -automatically. - -{% warning %} -Beware that no downgrade is possible once your database has been upgraded. -{% endwarning %} - -Your database needs to be upgraded to the latest minor version before having -access to the next major version. For instance, let's imagine that your version -is `2.3.x` and you want to upgrade to `3.1.x`. If there is a `2.5.x` version -available, you first need to upgrade your database to the `2.5.x` version -before upgrading to the `3.1.x` version. - -During the upgrade, a downtime can unfortunately happen, depending on the Plan -you are using and the upgrade: -- **Starter Plans**: In all cases, we have to stop the node to upgrade it, - causing an inevitable downtime. -- **Business Plans**: We are able to achieve zero-downtime upgrade of - minor version. In the case of major version upgrade, we need to completely - stop the nodes, hence causing an inevitable downtime. - -In both cases, once the operation is finished, the application is restarted. - -{% note %} -There are a couple more prerequisites when upgrading from MySQL® 5.7 to 8.0. -Please make sure to check [these mandatory prerequisites]({% post_url databases/mysql/2000-01-01-mysql-8-prerequisites %}).\ -Upgrading to MySQL® 8.0 is mandatory to benefit from MySQL® high availability via -Business Plans. -{% 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-scalingo-for-mysql-dashboard) -2. Select the **Settings** tab -3. In the **Settings** submenu, select the **General** tab -4. Locate the **Database Version** block -5. If an upgrade is available, a button allows you to trigger the upgrade -6. Click the button to launch the upgrade process - -{% note %} -Upgrading a MySQL® addon to a newer version is only available through the -database dashboard. -{% endnote %} - - -## Managing Users - -By default, Scalingo creates a user with read and write permissions on your -database with the following queries: - -```sql -GRANT ALL PRIVILEGES ON .* TO ''@'%' -``` - -{% note %} -It is not possible to delete a protected user or change their password. -{% endnote %} - -### Listing Users - -#### Using the Database Dashboard - -1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-scalingo-for-mysql-dashboard) -2. Click the **Settings** tab -3. In the **Settings** submenu, select **Users** -4. The list of available users is displayed in the **User Management** block - -#### 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 - -The following restrictions apply when creating a new user, regardless of the -method you use: - -- Username: - - Must be between 6 and 16 characters long - - Can only contain alphanumerical characters and underscores (`_`) - - Must start with a letter -- Password: - - Must be between 24 and 64 characters long. - - Must not contain the character `"` or `'` - -#### Using the Database Dashboard - -{% note %} -If you want to define a user password, this can only be done via the command line. -{% endnote %} - -1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-scalingo-for-mysql-dashboard) -2. Click the **Settings** tab -3. In the **Settings** submenu, select **Users** -4. Fill the **Add a user** form: - - Fill a username - - To grant write abilities to this user, make sure to check the **Write (optional)** checkbox -5. Validate by clicking the **Add this user** button - -{% note %} -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. -{% endnote %} - -#### 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 - ``` - 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 - ``` -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 - -#### Using the Database Dashboard - -{% note %} -If you want to define a user password, this can only be done via the command line. -{% endnote %} - -1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-scalingo-for-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 **"…"** 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 - -{% note %} -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. -{% endnote %} - -#### 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 - ``` -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". - ``` - -### Updating the Default User Password - -To change the default user password, contact support as this can only be done by the Scalingo team. - -{% note %} -The default user is created along with the addon and included in the default environment variable `SCALINGO_MYSQL_URL`. -{% endnote %} - -### Deleting an Existing 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-scalingo-for-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 **"…"** 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 - ``` - -## Using Multiple Databases - -Each Scalingo for MySQL® addon comes with a default database. You can, however, -create multiple databases on the same Scalingo for MySQL® instance. In this -case: -- The memory and disk storage allocated in the plan are shared between all - databases -- By default, the database users (the default one and the ones you could have - created) are shared between databases, even for existing ones -- All databases are [backed up]({% post_url databases/mysql/2000-01-01-backing-up %}) - in the same backup file -- The platform doesn't provide any environment variable for this new database. - You should, however, be able to generate one from the original - `SCALINGO_MYSQL_URL`. - -### Listing Existing Databases - -#### Using the Database Dashboard - -1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-scalingo-for-mysql-dashboard) -2. Click the **Settings** tab -3. In the **Settings** submenu, select **Databases** - -{% note %} -Listing existing databases is only available from the Database Dashboard. -{% endnote %} - -### Creating a New Database - -#### Using the Database Dashboard - -1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-scalingo-for-mysql-dashboard) -2. Click the **Settings** tab -3. In the **Settings** submenu, select **Databases** -4. Fill the **Add a database** form by specifying a **name** for the new - database -5. Validate the form by clicking the **Create this database** button - -{% note %} -Creating a new database is only available from the Database Dashboard. -{% endnote %} - -### Deleting a Database - -{% note %} -The default database can not be deleted. It can only be emptied. -{% endnote %} - -{% warning %} -Consider [creating a backup]({% post_url databases/mysql/2000-01-01-backing-up %}#creating-a-manual-backup) -prior to deleting a database. -{% endwarning%} - -#### Using the Database Dashboard - -1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-scalingo-for-mysql-dashboard) -2. Click the **Settings** tab -3. In the **Settings** submenu, select **Databases** -4. Locate the database you want to remove -5. Click the **"…"** button next to the database -6. From the popup menu, select **Drop** -7. In the popup window, confirm the deletion by typing the name of the database -8. Validate by clicking the **Confirm** button - -{% note %} -Deleting a database is only available from the Database Dashboard. -{% endnote %} - - -## Working with SQL Modes - -SQL modes allow you to configure MySQL® to behave according to specific -standards, adjusting how it processes queries and verifies data validity. This -includes settings that can make MySQL® more strict or more flexible regarding -SQL syntax and data constraints, providing developers the ability to optimize -database performances based on their application's requirements. - -Scalingo doesn't moderate the modes available, which means all modes supported -by your addon are indeed available. The exhaustive list may vary depending on -your MySQL® version. Descriptions of the modes can be found in the official -MySQL® documentation: - -- [for MySQL® `5.7` `EOL`](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html) -- [for MySQL® `8.0`](https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html) - -Currently, the default SQL mode includes: `ONLY_FULL_GROUP_BY`, -`STRICT_TRANS_TABLES`, `NO_ZERO_IN_DATE`, `NO_ZERO_DATE`, -`ERROR_FOR_DIVISION_BY_ZERO`, and `NO_ENGINE_SUBSTITUTION`. - -### Setting SQL Modes - -#### 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 **Configuration** -4. Click the **Manage SQL modes** button -5. Select the mode(s) you are interested in -6. Validate by clicking the **Update configuration** button -7. The changes are done at runtime, which means they immediately apply to new - queries - -{% note %} -Setting SQL modes is only available through the database dashboard. MySQL® -users provided by the platform do not have the necessary permissions to perform -these actions via the MySQL® console. -{% endnote %} diff --git a/src/_posts/databases/mysql/2000-01-01-troubleshooting.md b/src/_posts/databases/mysql/2000-01-01-troubleshooting.md index 200f5e78d..0dafa8727 100644 --- a/src/_posts/databases/mysql/2000-01-01-troubleshooting.md +++ b/src/_posts/databases/mysql/2000-01-01-troubleshooting.md @@ -27,7 +27,7 @@ memory pages to disk, leading to performance degradation and increased latency. As a consequence, the size of the Buffer Pool should ideally be large enough to handle the database workload, thus preventing swap usage. A constantly swapping database could indicate that the space dedicated to the Buffer Pool has become -insufficient. In such a case, [switching to a superior plan]({% post_url databases/mysql/2000-01-01-managing %}#scaling-changing-plan) +insufficient. In such a case, [switching to a superior plan]({% post_url databases/mysql/2000-01-01-changing-plan %}) should quickly resolve the swapping issue. For further details about how MySQL® manages memory, please refer to [the diff --git a/src/_posts/databases/mysql/2000-01-01-upgrading.md b/src/_posts/databases/mysql/2000-01-01-upgrading.md new file mode 100644 index 000000000..e4bb8883d --- /dev/null +++ b/src/_posts/databases/mysql/2000-01-01-upgrading.md @@ -0,0 +1,166 @@ +--- +title: Upgrading Your Scalingo for MySQL® Addon +nav: Upgrading +modified_at: 2025-03-27 12:00:00 +tags: databases mysql addon +index: 8 +--- + +In Scalingo's terminology, ***upgrading*** a Scalingo for MySQL® addon +designates the operation consisting in changing the database version for a +newer one. + +**Currently**, Scalingo only supports the `8.0.x` branch of MySQL® Community +Edition, meaning the only upgrades available are ***patch-upgrades***. + +As explained in [the official documentation](https://dev.mysql.com/blog-archive/introducing-mysql-innovation-and-long-term-support-lts-versions/), +and starting with MySQL® `8.0.34`, the patch-upgrades only contain bug and +security fixes. Consequently, it should be rather safe to upgrade to a new +`8.0.x` version. + +While we usually advise to stick to the latest patch-upgrade available to +benefit from bug and security fixes, we also strongly advise to take extra-care +when upgrading your Scalingo for MySQL® addon ([more about this below](#best-practices-before-upgrading)). + +Upgrading to a newer version is still your choice. + +{% warning %} +Beware that no downgrade is possible once your database has been upgraded. +{% endwarning %} + + +## Understanding the Patch-Upgrade Process + +### Prerequisites + +There are no prerequisites for patch-upgrades. + +### Process + +#### For Starter Plans + +1. The instance is stopped. The database is unreachable. +2. We restart the instance with the targeted version. This operation can take + quite some time, depending on the database size. +3. Once the instance restarted, the database is reachable again. +4. The application is restarted to ensure proper connections. [This does not + cause any additional downtime]({% post_url platform/internals/2000-01-01-container-management %}#zero-downtime-operations). + +Since we have to completely stop the instance, **a downtime is inevitable**. + +#### For Business Plans + +1. The MySQL® for Scalingo cluster Routers are restarted one by one with the + targeted version. This shouldn't cause any downtime. +2. We restart the different cluster nodes one by one. This shouldn't cause any + downtime, thanks to the MySQL Router® routing the connexions to available + nodes. +3. Once all the nodes are restarted, the cluster is fully upgraded and fully + operational again. +4. The application is restarted to ensure proper connections. [This does not + cause any additional downtime]({% post_url platform/internals/2000-01-01-container-management %}#zero-downtime-operations). + +Patch-upgrades of Business plans are **usually achieved without any impactful +downtime**. + +### Best Practices Before Upgrading + +{% note %} +There are a couple more prerequisites when upgrading from MySQL® 5.7 to 8.0. +Please make sure to check [these mandatory prerequisites]({% post_url databases/mysql/2000-01-01-mysql-8-prerequisites %}).\ +Upgrading to MySQL® 8.0 is mandatory to benefit from MySQL® high availability +via Business Plans. +{% endnote %} + +Although patch-upgrades should only bring bug and security fixes, we still +advise to take extra care when dealing with them: + +- First, carefully read the changelogs provided by MySQL® (we usually link them + in our respective changelog entries). Identifying noticeable changes, + especially ones that may have a negative impact on your database or app, will + allow you to update your application accordingly. + +- We also generally advise to test the changes in a [Review App]({% post_url platform/app/2000-01-01-review-apps %}). + + The use of Review Apps can be deactivated on your production application, [as + we recommend]({% post_url platform/app/2000-01-01-review-apps %}#configuration-of-review-apps) + in our documentation. In general, it is recommended that you carry out this + process on a staging application using the same code repository, but linked + to a database with no production or customer data. Once you have activated + the Review Apps feature, you can create a pull request in which you can + modify the `scalingo.json` manifest file to force the deployment of a + specific version of MySQL®. The full process is as follow: + + 1. Create a new app dedicated to this upgrade. + 2. Link this app to your application's code repository. + 3. Make sure to enable Review Apps for this application. + 4. Leverage the [`scalingo.json` manifest file]({% post_url platform/app/2000-01-01-app-manifest %}) + to: + - Specify the version of the database addon you require. This version + should match the one you are using in your production environment. + - Ideally ask the platform to fill your database with **testing data**, + using a [`first-deploy` script]({% post_url platform/app/2000-01-01-app-manifest %}#deployment-hooks). + + Here is an example of a manifest file asking the platform to provision a + MySQL `8.0.38` addon and to run the `db-seed.sh` script after the + first deployment (the script must be included in your codebase): + ```json + { + "addons": [ + { + "plan": "mysql:mysql-starter-512", + "options": { + "version": "8.0.38" + } + } + ], + + "env": { + "CANONICAL_HOST_URL": { + "generator": "url" + } + }, + + "scripts": { + "first-deploy": "bash -c db-seed.sh" + } + } + ``` + 5. Create a new Pull Request from the repository hosting your application's + code. A new Review App is created with the appropriate database version. + If you have a `first-deploy` script in your `scalingo.json` manifest, it's + executed. + 6. (optional): If you couldn't use a `first-deploy` script, it's now + time to fill your database with your test dataset. + 7. Once filled with testing data, upgrade your database until it reaches the + targeted version. + 8. Execute your tests scenarios on the Review App. This should help you + validate the changes, or identify the required fixes before sending them + to production. + 9. Once done, close the Pull Request to automatically destroy the linked + Review App. You can now plan the production upgrade. + +- [Create a manual backup]({% post_url databases/mysql/2000-01-01-backing-up %}#creating-a-manual-backup) + of your current production database just before making the move in your + production environment. + +- [Put the app in maintenance mode]({% post_url platform/app/2000-01-01-custom-error-page %}#custom-maintenance-page) + during the upgrade operations, especially if a significant downtime is + expected. + + +## Upgrading + +{% note %} +Upgrading a Scalingo for MySQL® addon to a newer version is only available +through the database dashboard. +{% 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-scalingo-for-mysql-dashboard) +2. Select the **Settings** tab +3. In the **Settings** submenu, select the **General** tab +4. Locate the **Database Version** block +5. If an upgrade is available, a button allows you to trigger the upgrade +6. Click the button to launch the upgrade process diff --git a/src/_posts/databases/mysql/2000-01-01-using-multiple-databases.md b/src/_posts/databases/mysql/2000-01-01-using-multiple-databases.md new file mode 100644 index 000000000..d96d8f314 --- /dev/null +++ b/src/_posts/databases/mysql/2000-01-01-using-multiple-databases.md @@ -0,0 +1,77 @@ +--- +title: Using Multiple Databases +nav: Using Multiple Databases +modified_at: 2025-03-27 12:00:00 +tags: databases mysql addon +index: 12 +--- + + +Each Scalingo for MySQL® addon comes with a default database. You can, however, +create multiple databases on the same Scalingo for MySQL® instance. In this +case: +- The memory and disk storage allocated in the plan are shared between all + databases +- By default, the database users (the default one and the ones you could have + created) are shared between databases, even for existing ones +- All databases are [backed up]({% post_url databases/mysql/2000-01-01-backing-up %}) + in the same backup file +- The platform doesn't provide any environment variable for this new database. + You should, however, be able to generate one from the original + `SCALINGO_MYSQL_URL`. + + +## Listing Existing Databases + +### Using the Database Dashboard + +1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-scalingo-for-mysql-dashboard) +2. Click the **Settings** tab +3. In the **Settings** submenu, select **Databases** + +{% note %} +Listing existing databases is only available from the Database Dashboard. +{% endnote %} + + +## Creating a New Database + +### Using the Database Dashboard + +1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-scalingo-for-mysql-dashboard) +2. Click the **Settings** tab +3. In the **Settings** submenu, select **Databases** +4. Fill the **Add a database** form by specifying a **name** for the new + database +5. Validate the form by clicking the **Create this database** button + +{% note %} +Creating a new database is only available from the Database Dashboard. +{% endnote %} + + +## Deleting a Database + +{% note %} +The default database can not be deleted. It can only be emptied. +{% endnote %} + +{% warning %} +Consider [creating a backup]({% post_url databases/mysql/2000-01-01-backing-up %}#creating-a-manual-backup) +prior to deleting a database. +{% endwarning%} + +### Using the Database Dashboard + +1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-scalingo-for-mysql-dashboard) +2. Click the **Settings** tab +3. In the **Settings** submenu, select **Databases** +4. Locate the database you want to remove +5. Click the **"…"** button next to the database +6. From the popup menu, select **Drop** +7. In the popup window, confirm the deletion by typing the name of the database +8. Validate by clicking the **Confirm** button + +{% note %} +Deleting a database is only available from the Database Dashboard. +{% endnote %} diff --git a/src/_posts/databases/mysql/2000-01-01-working-with-sql-modes.md b/src/_posts/databases/mysql/2000-01-01-working-with-sql-modes.md new file mode 100644 index 000000000..62078cbdf --- /dev/null +++ b/src/_posts/databases/mysql/2000-01-01-working-with-sql-modes.md @@ -0,0 +1,50 @@ +--- +title: Working with SQL Modes +nav: Working with SQL Modes +modified_at: 2025-03-27 12:00:00 +tags: databases mysql addon modes +index: 13 +--- + + +SQL modes allow you to configure MySQL® to behave according to specific +standards, adjusting how it processes queries and verifies data validity. This +includes settings that can make MySQL® more strict or more flexible regarding +SQL syntax and data constraints, providing developers the ability to optimize +database performances based on their application's requirements. + +Scalingo doesn't moderate the modes available, which means all modes supported +by your addon are indeed available. The exhaustive list may vary depending on +your MySQL® version. Descriptions of the modes can be found in the official +MySQL® documentation: + +- [for MySQL® `5.7` `EOL`](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html) +- [for MySQL® `8.0`](https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html) + +Currently, the default SQL mode includes: +- `ONLY_FULL_GROUP_BY` +- `STRICT_TRANS_TABLES` +- `NO_ZERO_IN_DATE` +- `NO_ZERO_DATE` +- `ERROR_FOR_DIVISION_BY_ZERO` +- `NO_ENGINE_SUBSTITUTION` + + +## Setting SQL Modes + +### 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 **Configuration** +4. Click the **Manage SQL modes** button +5. Select the mode(s) you are interested in +6. Validate by clicking the **Update configuration** button +7. The changes are done at runtime, which means they immediately apply to new + queries + +{% note %} +Setting SQL modes is only available through the database dashboard. MySQL® +users provided by the platform do not have the necessary permissions to perform +these actions via the MySQL® console. +{% endnote %} From 5d9b0ad8cf66151111023aae2f567dd7888a75af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20KUBLER?= Date: Thu, 27 Mar 2025 16:09:51 +0100 Subject: [PATCH 2/7] fix(postgresql): update some mistakes --- .../postgresql/2000-01-01-changing-plan.md | 15 ++++-- .../postgresql/2000-01-01-managing-users.md | 50 ++++++++++++++----- .../postgresql/2000-01-01-upgrading.md | 10 ++-- 3 files changed, 54 insertions(+), 21 deletions(-) diff --git a/src/_posts/databases/postgresql/2000-01-01-changing-plan.md b/src/_posts/databases/postgresql/2000-01-01-changing-plan.md index 27cb50cbc..1a3fa3d9e 100644 --- a/src/_posts/databases/postgresql/2000-01-01-changing-plan.md +++ b/src/_posts/databases/postgresql/2000-01-01-changing-plan.md @@ -92,6 +92,17 @@ operation, thanks to the failover mechanism included in the Business plan. 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/postgresql/2000-01-01-getting-started %}#accessing-the-postgresql-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 %}) @@ -134,6 +145,4 @@ operation, thanks to the failover mechanism included in the Business plan. } ``` In this example, we switch the `my-db` resource attached to the `my-app` - application to a PostgreSQL Business 1024 addon. -2. Run `terraform plan` and check if the result looks good -3. If so, run `terraform apply` + application to a PostgreSQL® Business 1024 addon. diff --git a/src/_posts/databases/postgresql/2000-01-01-managing-users.md b/src/_posts/databases/postgresql/2000-01-01-managing-users.md index 9105db2e2..40cb30dd7 100644 --- a/src/_posts/databases/postgresql/2000-01-01-managing-users.md +++ b/src/_posts/databases/postgresql/2000-01-01-managing-users.md @@ -38,8 +38,9 @@ This default user is ***protected*** and thus: ### Using the Database Dashboard 1. From your web browser, open your [database dashboard]({% post_url databases/postgresql/2000-01-01-getting-started %}#accessing-the-postgresql-dashboard) -2. Click the **Users** tab -3. The list of available users is displayed under the **User Management** +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 @@ -81,13 +82,16 @@ method used: ### Using the Database Dashboard 1. From your web browser, open your [database dashboard]({% post_url databases/postgresql/2000-01-01-getting-started %}#accessing-the-scalingo-for-postgresql-dashboard) -2. Click the **Users** tab -3. Fill the **Add a new user** form: +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 - - Fill the corresponding password twice -4. (optional) If you want to restrict this user to read only abilities, make - sure to check the **Read only** checkbox -5. Validate by clicking the **Add User** button + - 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 @@ -119,9 +123,26 @@ method used: ## Updating a User Password {% note %} -Updating a User Password is only available from the command line. +- 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/postgresql/2000-01-01-getting-started %}#accessing-the-postgresql-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 **"…"** 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 %}) @@ -148,10 +169,13 @@ Updating a User Password is only available from the command line. ### Using the Database Dashboard 1. From your web browser, open your [database dashboard]({% post_url databases/postgresql/2000-01-01-getting-started %}#accessing-the-scalingo-for-postgresql-dashboard) -2. Click the **Users** tab -3. Locate the user you want to remove -4. Click the **Delete** button next to the user -5. Confirm the removal +2. Click the **Settings** tab +3. In the **Settings** submenu, select **Users** +4. Locate the user you want to remove +5. Click the **"…"** 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 diff --git a/src/_posts/databases/postgresql/2000-01-01-upgrading.md b/src/_posts/databases/postgresql/2000-01-01-upgrading.md index 1ef7513bc..9ea50c854 100644 --- a/src/_posts/databases/postgresql/2000-01-01-upgrading.md +++ b/src/_posts/databases/postgresql/2000-01-01-upgrading.md @@ -228,8 +228,8 @@ database dashboard. ### Using the Database Dashboard 1. From your web browser, open your [database dashboard]({% post_url databases/postgresql/2000-01-01-getting-started %}#accessing-the-scalingo-for-postgresql-dashboard) -2. Click the **Overview** tab -3. Locate the **Database Upgrade** block -4. If an upgrade is available, the text in the block explains what will be - done. -5. To launch the upgrade, click the **Upgrade to …** button +2. Select the **Settings** tab +3. In the **Settings** submenu, select the **General** tab +4. Locate the **Database Version** block +5. If an upgrade is available, a button allows you to trigger the upgrade +6. Click the button to launch the upgrade process From 1201a4a1d806962f56c1792478ad45eb1c667494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20KUBLER?= Date: Mon, 31 Mar 2025 17:05:58 +0200 Subject: [PATCH 3/7] fix: misc. fixes after proof-reading --- .../mysql/2000-01-01-changing-plan.md | 23 +++++----- .../mysql/2000-01-01-managing-users.md | 22 ++++----- .../databases/mysql/2000-01-01-upgrading.md | 20 ++++----- .../2000-01-01-using-multiple-databases.md | 45 ++++++++++++------- .../2000-01-01-working-with-sql-modes.md | 15 +++---- 5 files changed, 70 insertions(+), 55 deletions(-) diff --git a/src/_posts/databases/mysql/2000-01-01-changing-plan.md b/src/_posts/databases/mysql/2000-01-01-changing-plan.md index 1db0e010b..0956302cf 100644 --- a/src/_posts/databases/mysql/2000-01-01-changing-plan.md +++ b/src/_posts/databases/mysql/2000-01-01-changing-plan.md @@ -1,7 +1,7 @@ --- title: Changing Plan nav: Changing Plan -modified_at: 2025-03-13 12:00:00 +modified_at: 2025-03-31 12:00:00 tags: databases mysql addon index: 7 --- @@ -33,8 +33,8 @@ handle all your data and fits your application workload. {% note %} Business Plans are only available starting with MySQL® 8.\ -Consider [upgrading to MySQL® 8](#upgrading-to-mysql-8) if you want to benefit -from high availability with MySQL®. +Consider [upgrading to MySQL® 8]({% post_url databases/mysql/2000-01-01-mysql-8-prerequisites %}) +if you want to benefit from high availability with MySQL®. {% endnote %} ### From Starter to Starter @@ -50,7 +50,7 @@ though. ### From Starter to Business -When changing for a Business plan, the platform starts additional nodes +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. @@ -61,10 +61,10 @@ the failover mechanism included with the Business plan. ### From Business to Starter -When changing for a lower class, the platform first powers the surplus nodes -off. When necessary, the remaining node 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. +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 | | ------------ | ---------- | --------- | -------- | ------------ | @@ -74,9 +74,10 @@ available. This shouldn't exceed a few seconds though. ### From Business to Business -When changing the size of a Business plan, the platform reboots the nodes 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. +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 | | ------------ | ---------- | --------- | -------- | ------------ | diff --git a/src/_posts/databases/mysql/2000-01-01-managing-users.md b/src/_posts/databases/mysql/2000-01-01-managing-users.md index 5e6eb3a61..3bd3b9ae2 100644 --- a/src/_posts/databases/mysql/2000-01-01-managing-users.md +++ b/src/_posts/databases/mysql/2000-01-01-managing-users.md @@ -1,12 +1,12 @@ --- title: Managing Users of Your Scalingo for MySQL® Addon nav: Managing Users -modified_at: 2025-03-13 12:00:00 +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-users). +Each Scalingo for MySQL® addon comes with a [default database user](#understanding-protected-users). 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. @@ -16,7 +16,7 @@ them once they are not required anymore. ### Understanding Protected User -When provisioning a new Scalingo for MySQL addon, the platform creates a +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: @@ -62,16 +62,18 @@ This default user is ***protected*** and thus: ## 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 - - Must be between 6 and 32 characters long - - Can only contain alphanumerical characters and underscores (`_`) -- Password: - - Must be between 24 and 64 characters long. - - Must not contain the character `"` or `'` +- Username **must**: + - Start with a letter + - Be between 6 and 32 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 diff --git a/src/_posts/databases/mysql/2000-01-01-upgrading.md b/src/_posts/databases/mysql/2000-01-01-upgrading.md index e4bb8883d..c736762d8 100644 --- a/src/_posts/databases/mysql/2000-01-01-upgrading.md +++ b/src/_posts/databases/mysql/2000-01-01-upgrading.md @@ -22,8 +22,6 @@ While we usually advise to stick to the latest patch-upgrade available to benefit from bug and security fixes, we also strongly advise to take extra-care when upgrading your Scalingo for MySQL® addon ([more about this below](#best-practices-before-upgrading)). -Upgrading to a newer version is still your choice. - {% warning %} Beware that no downgrade is possible once your database has been upgraded. {% endwarning %} @@ -40,9 +38,9 @@ There are no prerequisites for patch-upgrades. #### For Starter Plans 1. The instance is stopped. The database is unreachable. -2. We restart the instance with the targeted version. This operation can take - quite some time, depending on the database size. -3. Once the instance restarted, the database is reachable again. +2. The instance is restarted with the targeted version. This operation can take + quite some time depending on the database size. +3. Once the instance is restarted, the database is reachable again. 4. The application is restarted to ensure proper connections. [This does not cause any additional downtime]({% post_url platform/internals/2000-01-01-container-management %}#zero-downtime-operations). @@ -50,11 +48,11 @@ Since we have to completely stop the instance, **a downtime is inevitable**. #### For Business Plans -1. The MySQL® for Scalingo cluster Routers are restarted one by one with the - targeted version. This shouldn't cause any downtime. -2. We restart the different cluster nodes one by one. This shouldn't cause any - downtime, thanks to the MySQL Router® routing the connexions to available - nodes. +1. The Scalingo for MySQL® Routers of the cluster are restarted one by one with + the targeted version. This shouldn't cause any downtime. +2. The different instances forming the cluster are restarted one by one. This + shouldn't cause any downtime, thanks to the MySQL® Routers routing the + connexions to the available instances. 3. Once all the nodes are restarted, the cluster is fully upgraded and fully operational again. 4. The application is restarted to ensure proper connections. [This does not @@ -102,7 +100,7 @@ advise to take extra care when dealing with them: using a [`first-deploy` script]({% post_url platform/app/2000-01-01-app-manifest %}#deployment-hooks). Here is an example of a manifest file asking the platform to provision a - MySQL `8.0.38` addon and to run the `db-seed.sh` script after the + MySQL® `8.0.38` addon and to run the `db-seed.sh` script after the first deployment (the script must be included in your codebase): ```json { diff --git a/src/_posts/databases/mysql/2000-01-01-using-multiple-databases.md b/src/_posts/databases/mysql/2000-01-01-using-multiple-databases.md index d96d8f314..a77392529 100644 --- a/src/_posts/databases/mysql/2000-01-01-using-multiple-databases.md +++ b/src/_posts/databases/mysql/2000-01-01-using-multiple-databases.md @@ -1,7 +1,7 @@ --- title: Using Multiple Databases nav: Using Multiple Databases -modified_at: 2025-03-27 12:00:00 +modified_at: 2025-03-31 12:00:00 tags: databases mysql addon index: 12 --- @@ -16,8 +16,8 @@ case: created) are shared between databases, even for existing ones - All databases are [backed up]({% post_url databases/mysql/2000-01-01-backing-up %}) in the same backup file -- The platform doesn't provide any environment variable for this new database. - You should, however, be able to generate one from the original +- The platform doesn't provide any environment variable for these additional + databases. You should, however, be able to generate one from the original `SCALINGO_MYSQL_URL`. @@ -29,13 +29,35 @@ case: 2. Click the **Settings** tab 3. In the **Settings** submenu, select **Databases** -{% note %} -Listing existing databases is only available from the Database Dashboard. -{% endnote %} +### Using the Command Line Tool + +1. Access your database using the [Interactive Remote Console]({% post_url databases/mysql/2000-01-01-accessing %}#using-the-interactive-remote-console) +2. From the MySQL® console, run the following command: + ```sql + SHOW DATABASES; + ``` + The ouput should look like this: + ``` + mysql> SHOW DATABASES; + +--------------------+ + | Database | + +--------------------+ + | my_app_5432 | + | my_database01 | + | my_database02 | + | information_schema | + | performance_schema | + +--------------------+ + 5 rows in set (0.01 sec) + ``` ## Creating a New Database +{% note %} +Creating a new database is only available from the Database Dashboard. +{% 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-scalingo-for-mysql-dashboard) @@ -45,15 +67,12 @@ Listing existing databases is only available from the Database Dashboard. database 5. Validate the form by clicking the **Create this database** button -{% note %} -Creating a new database is only available from the Database Dashboard. -{% endnote %} - ## Deleting a Database {% note %} -The default database can not be deleted. It can only be emptied. +- The default database can not be deleted. It can only be emptied. +- Deleting a database is only available from the Database Dashboard. {% endnote %} {% warning %} @@ -71,7 +90,3 @@ prior to deleting a database. 6. From the popup menu, select **Drop** 7. In the popup window, confirm the deletion by typing the name of the database 8. Validate by clicking the **Confirm** button - -{% note %} -Deleting a database is only available from the Database Dashboard. -{% endnote %} diff --git a/src/_posts/databases/mysql/2000-01-01-working-with-sql-modes.md b/src/_posts/databases/mysql/2000-01-01-working-with-sql-modes.md index 62078cbdf..ab20c755d 100644 --- a/src/_posts/databases/mysql/2000-01-01-working-with-sql-modes.md +++ b/src/_posts/databases/mysql/2000-01-01-working-with-sql-modes.md @@ -1,7 +1,7 @@ --- title: Working with SQL Modes nav: Working with SQL Modes -modified_at: 2025-03-27 12:00:00 +modified_at: 2025-03-31 12:00:00 tags: databases mysql addon modes index: 13 --- @@ -18,7 +18,6 @@ by your addon are indeed available. The exhaustive list may vary depending on your MySQL® version. Descriptions of the modes can be found in the official MySQL® documentation: -- [for MySQL® `5.7` `EOL`](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html) - [for MySQL® `8.0`](https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html) Currently, the default SQL mode includes: @@ -32,6 +31,12 @@ Currently, the default SQL mode includes: ## Setting SQL Modes +{% note %} +Setting SQL modes is only available through the database dashboard. MySQL® +users provided by the platform do not have the necessary permissions to perform +these actions via the MySQL® console. +{% 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) @@ -42,9 +47,3 @@ Currently, the default SQL mode includes: 6. Validate by clicking the **Update configuration** button 7. The changes are done at runtime, which means they immediately apply to new queries - -{% note %} -Setting SQL modes is only available through the database dashboard. MySQL® -users provided by the platform do not have the necessary permissions to perform -these actions via the MySQL® console. -{% endnote %} From 4df5313900e0372bb73cb81e1a028b868de483ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Tue, 22 Apr 2025 11:57:25 +0200 Subject: [PATCH 4/7] fix: apply suggestions from code review Co-authored-by: Pierre Curzola --- .../databases/mysql/2000-01-01-managing-users.md | 10 +++++----- src/_posts/databases/mysql/2000-01-01-upgrading.md | 4 ++-- .../mysql/2000-01-01-using-multiple-databases.md | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/_posts/databases/mysql/2000-01-01-managing-users.md b/src/_posts/databases/mysql/2000-01-01-managing-users.md index 3bd3b9ae2..88ed864ad 100644 --- a/src/_posts/databases/mysql/2000-01-01-managing-users.md +++ b/src/_posts/databases/mysql/2000-01-01-managing-users.md @@ -6,7 +6,7 @@ tags: databases mysql addon index: 5 --- -Each Scalingo for MySQL® addon comes with a [default database user](#understanding-protected-users). +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. @@ -32,7 +32,7 @@ This default user is ***protected*** and thus: ### Using the Database Dashboard -1. From your web browser, open your [database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-scalingo-for-mysql-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** @@ -68,7 +68,7 @@ method you use: - Username **must**: - Start with a letter - - Be between 6 and 32 characters long + - Be between 6 and 16 characters long - Contain only alphanumerical characters and underscores (`_`) - Password **must**: - Be between 24 and 64 characters long. @@ -126,7 +126,7 @@ method you use: ### Using the Database Dashboard -1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-scalingo-for-mysql-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 @@ -163,7 +163,7 @@ method you use: ### Using the Database Dashboard -1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-scalingo-for-mysql-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 diff --git a/src/_posts/databases/mysql/2000-01-01-upgrading.md b/src/_posts/databases/mysql/2000-01-01-upgrading.md index c736762d8..2375c3a26 100644 --- a/src/_posts/databases/mysql/2000-01-01-upgrading.md +++ b/src/_posts/databases/mysql/2000-01-01-upgrading.md @@ -41,7 +41,7 @@ There are no prerequisites for patch-upgrades. 2. The instance is restarted with the targeted version. This operation can take quite some time depending on the database size. 3. Once the instance is restarted, the database is reachable again. -4. The application is restarted to ensure proper connections. [This does not +4. The application to which the database is attached is restarted to ensure proper connections. [This does not cause any additional downtime]({% post_url platform/internals/2000-01-01-container-management %}#zero-downtime-operations). Since we have to completely stop the instance, **a downtime is inevitable**. @@ -156,7 +156,7 @@ through the database dashboard. ### Using the Database Dashboard -1. From your web browser, open your [database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-scalingo-for-mysql-dashboard) +1. From your web browser, open your [database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-mysql-dashboard) 2. Select the **Settings** tab 3. In the **Settings** submenu, select the **General** tab 4. Locate the **Database Version** block diff --git a/src/_posts/databases/mysql/2000-01-01-using-multiple-databases.md b/src/_posts/databases/mysql/2000-01-01-using-multiple-databases.md index a77392529..800549841 100644 --- a/src/_posts/databases/mysql/2000-01-01-using-multiple-databases.md +++ b/src/_posts/databases/mysql/2000-01-01-using-multiple-databases.md @@ -25,7 +25,7 @@ case: ### Using the Database Dashboard -1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-scalingo-for-mysql-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 **Databases** @@ -60,7 +60,7 @@ Creating a new database is only available from the Database Dashboard. ### Using the Database Dashboard -1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-scalingo-for-mysql-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 **Databases** 4. Fill the **Add a database** form by specifying a **name** for the new @@ -82,7 +82,7 @@ prior to deleting a database. ### Using the Database Dashboard -1. From your web browser, [open your database dashboard]({% post_url databases/mysql/2000-01-01-getting-started %}#accessing-the-scalingo-for-mysql-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 **Databases** 4. Locate the database you want to remove From e11923b1838ca608451ffabc4d96a5dd26e84478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20KUBLER?= Date: Tue, 22 Apr 2025 12:02:40 +0200 Subject: [PATCH 5/7] chore(mysql): remove MySQL 5.7 refs Applying review suggestions from @curzolapierre. --- src/_posts/databases/mysql/2000-01-01-changing-plan.md | 6 ------ src/_posts/databases/mysql/2000-01-01-upgrading.md | 7 ------- 2 files changed, 13 deletions(-) diff --git a/src/_posts/databases/mysql/2000-01-01-changing-plan.md b/src/_posts/databases/mysql/2000-01-01-changing-plan.md index 0956302cf..57911a928 100644 --- a/src/_posts/databases/mysql/2000-01-01-changing-plan.md +++ b/src/_posts/databases/mysql/2000-01-01-changing-plan.md @@ -31,12 +31,6 @@ handle all your data and fits your application workload. ## Understanding the Plan Change Process -{% note %} -Business Plans are only available starting with MySQL® 8.\ -Consider [upgrading to MySQL® 8]({% post_url databases/mysql/2000-01-01-mysql-8-prerequisites %}) -if you want to benefit from high availability with MySQL®. -{% endnote %} - ### From Starter to Starter When changing the size of a Starter plan, the platform reboots the existing diff --git a/src/_posts/databases/mysql/2000-01-01-upgrading.md b/src/_posts/databases/mysql/2000-01-01-upgrading.md index 2375c3a26..17d7446ff 100644 --- a/src/_posts/databases/mysql/2000-01-01-upgrading.md +++ b/src/_posts/databases/mysql/2000-01-01-upgrading.md @@ -63,13 +63,6 @@ downtime**. ### Best Practices Before Upgrading -{% note %} -There are a couple more prerequisites when upgrading from MySQL® 5.7 to 8.0. -Please make sure to check [these mandatory prerequisites]({% post_url databases/mysql/2000-01-01-mysql-8-prerequisites %}).\ -Upgrading to MySQL® 8.0 is mandatory to benefit from MySQL® high availability -via Business Plans. -{% endnote %} - Although patch-upgrades should only bring bug and security fixes, we still advise to take extra care when dealing with them: From b9d25fb8d344ffcdd791bb2a52e100add9ebde70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20KUBLER?= Date: Tue, 22 Apr 2025 12:23:20 +0200 Subject: [PATCH 6/7] chore(mysql): add redirection --- redirections.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/redirections.yml b/redirections.yml index 4d9bbdcfa..0f09d1691 100644 --- a/redirections.yml +++ b/redirections.yml @@ -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" @@ -620,6 +623,7 @@ - old: "/databases/mongodb/robo3t" new: "/databases/mongodb/studio3t" + obsolete: - "/how-to-migrate-from-cloudcontrol/" - "/how-to-migrate-from-shelly-cloud/" From 6f683c70c707c5eb8fcb0b5d6d819b0cd30a6e33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20KUBLER?= Date: Tue, 22 Apr 2025 12:28:03 +0200 Subject: [PATCH 7/7] chore(mysql): nitpicks --- src/_posts/databases/mysql/2000-01-01-upgrading.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/_posts/databases/mysql/2000-01-01-upgrading.md b/src/_posts/databases/mysql/2000-01-01-upgrading.md index 17d7446ff..36e8213d3 100644 --- a/src/_posts/databases/mysql/2000-01-01-upgrading.md +++ b/src/_posts/databases/mysql/2000-01-01-upgrading.md @@ -1,7 +1,7 @@ --- title: Upgrading Your Scalingo for MySQL® Addon nav: Upgrading -modified_at: 2025-03-27 12:00:00 +modified_at: 2025-04-22 12:00:00 tags: databases mysql addon index: 8 --- @@ -41,8 +41,8 @@ There are no prerequisites for patch-upgrades. 2. The instance is restarted with the targeted version. This operation can take quite some time depending on the database size. 3. Once the instance is restarted, the database is reachable again. -4. The application to which the database is attached is restarted to ensure proper connections. [This does not - cause any additional downtime]({% post_url platform/internals/2000-01-01-container-management %}#zero-downtime-operations). +4. The application to which the database is attached is restarted to ensure + proper connections. [This does not cause any additional downtime]({% post_url platform/internals/2000-01-01-container-management %}#zero-downtime-operations). Since we have to completely stop the instance, **a downtime is inevitable**. @@ -55,17 +55,14 @@ Since we have to completely stop the instance, **a downtime is inevitable**. connexions to the available instances. 3. Once all the nodes are restarted, the cluster is fully upgraded and fully operational again. -4. The application is restarted to ensure proper connections. [This does not - cause any additional downtime]({% post_url platform/internals/2000-01-01-container-management %}#zero-downtime-operations). +4. The application to which the database is attached is restarted to ensure + proper connections. [This does not cause any additional downtime]({% post_url platform/internals/2000-01-01-container-management %}#zero-downtime-operations). Patch-upgrades of Business plans are **usually achieved without any impactful downtime**. ### Best Practices Before Upgrading -Although patch-upgrades should only bring bug and security fixes, we still -advise to take extra care when dealing with them: - - First, carefully read the changelogs provided by MySQL® (we usually link them in our respective changelog entries). Identifying noticeable changes, especially ones that may have a negative impact on your database or app, will