Pav Sidhu
Pav Sidhu

Reputation: 6954

How do I increase MySQL database size?

I have an existing production database which only has 5GB of space, which is not enough. I would like to increase this size, however AWS does not let you do this with SQL databases. How should I do this?

I tried creating a snapshot and making a new database with it however I could not set the database size for some reason.

Is there a solution for this?

Upvotes: 1

Views: 6630

Answers (2)

Maurice Elagu
Maurice Elagu

Reputation: 704

Upgrading a MySQL DB instance can be tricky but easy to achieve through the following steps.

1. Ensure that running an updated version of MySQL Engine(not deprecated). Trying to upgrade a deprecated MySQL Version via the AWS Console(UI) results in an error message."

"Cannot find version 5.... for mysql (Service: AmazonRDS; Status Code: 400; Error Code: InvalidParameterCombination; Request ID:........"

Even Snapshot Restore is most likely to run for several mins/hours without any success.

2.Use AWS CLI

Use 'modify-db-instance' command to scale the storage size[1] and applied the version upgrade on your DB instance. Here's the example command:

aws rds modify-db-instance \ 
    --db-instance-identifier <RDS_identifier> \ 
    --allocated-storage <storage_size> \ 
    --apply-immediately 

You may also refer to this guide on to install AWS CLI toll: Installing the AWS Command Line Interface - [https://docs.aws.amazon.com/cli/latest/userguide/installing.html][1]

3.After the successful upgrade, optionally modify/upgrade your MySQL version to a non depreciated Version via the AWS Console(UI).

Upvotes: 0

Anthony Neace
Anthony Neace

Reputation: 26031

RDS instances have a set of settings exposed that you can modify. For RDS instances running MySQL, allocated storage size is one of these settings.

To modify a DB instance running the MySQL engine from the AWS web console (from linked documentation):

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the navigation pane, click Instances.

  3. Select the check box for the DB instance that you want to change, click Instance Actions and then click Modify.

  4. In the Modify DB Instance dialog box, modify [the setting labeled "Allocated Storage"].

At the bottom of the Modify DB instance dialog, there is a checkbox labeled "apply immediately." If this checkbox is selected, the change will begin immediately and your RDS instance will enter the modifying state. No further modifications can be made to the instance settings during this time. Your database should not experience downtime while these changes are being made, but performance will be degraded. If you do not select this checkbox, the change will be applied during your RDS instance's next maintenance window.

Note that altering other settings and applying immediately can result in downtime, depending on what you want to change. Check this documentation for a full list.

You can alternatively perform this operation programmatically, via:

Upvotes: 2

Related Questions