How to update the database of a CMS on Fortrabbit using a local DB

Prepare the database, open the tunnel in Terminal and in a separate Terminal, run the mysql command, through the example of a CraftCMS hosted on Fortrabbit.

Oscar de la Hera Gomez
Written by Oscar de la Hera Gomez
First published on 09/15/2024 at 15:15
Last Updated on 09/15/2024 at 15:39
<p>A flower that represents CraftCMS with the text "Locally update the database of a hosted CraftCMS" beneath it.</p>

Prepare the database, open the tunnel in Terminal and in a separate Terminal, run the mysql command, through the example of a CraftCMS hosted on Fortrabbit.

Subscribe

Step One: Setup the DB

<p>A screenshot of CraftCMS demonstrating how to download a DB using the Backup utility.</p>

To avoid the error message: ERROR 1227 (42000) at line 18: Access denied; you need (at least one of) the SUPER, SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN privilege(s) for this operation, we recommend that you import the DB into a DDEV instance of CraftCMS and download it through the Craft CMS Utilities.

How to import a DB to a local Craft CMS running on DDEVHow to fix database privilege issues for a Craft CMS on Fortrabbit

Step Two: Open up a Tunnel

<p>A screenshot of the Fortrabbit documentation showing you how to open a tunnel.</p>

Navigate to the link below to learn how to open up a tunnel to Fortrabbit in Terminal.

Please note that the Examples dropdown on the top right can be updated to give you the exact line for opening a tunnel for your app.

Fortrabbit: How to export and import a MySQL database

Step Three: Import the DB

<p>A screenshot of Fortrabbit showing where the MySQL password is found within an app.</p>

The image above demonstrates where to find the password for the MySQL command.

Open a separate terminal and run the line below, replacing LOCAL_PATH_TO_YOUR_DB.sql with the path to the database.

mysql -h127.0.0.1 -P13306 -ucraft3-xs7n -p craft3-xs7n &lt; LOCAL_PATH_TO_YOUR_DB.sql

You will be prompted to put in a password, input the MySQL password found in your app on the Fortrabbit website.

Looking to learn more about CraftCMS?

Search our blog to learn more about CraftCMS, design and technology.

Search our Blog

Any Questions?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.
SubscribeContact UsVisit our BlogView our ServicesView our Work

Partner with us

We would love to get to know you and see how we can help your organization with its goals and needs.
Let's Talk

Stay Informed

Get occasional updates about our company, research, and product launches.
Subscribe