Adminer
Adminer (formerly phpMinAdmin) is a full-featured database management tool written in PHP. Unlike phpMyAdmin, it offers a single-file deployment, making it highly convenient for target servers. Adminer supports various databases, including MySQL, MariaDB, PostgreSQL, SQLite, MS SQL, Oracle, Elasticsearch, MongoDB, and more through plugins. Its simplicity and broad compatibility make Adminer an efficient choice for database management.
This guide will walk you through deploying Adminer on Google App Engine standard environment, allowing you to connect to SQL servers using both Private and Public IPs.
Prerequisites
Before getting started, make sure you have the following:
- A Google Cloud Platform account.
- Basic knowledge of GCP services.
Step 1: Set up a GCP Project
- Open the Google Cloud Console.
- Create a new project or select an existing one.
Step 2: Enable App Engine API
- Navigate to the
App Engine
section in the Google Cloud Console. - Enable App Engine for your project if it's not already enabled.
Step 3: Download the Adminer
You'll deploy Adminer as a service of your App Engine Standard application, so you must download the source code for Adminer. Follow these steps:
- Open the Cloud Shell Terminal by navigating to the
Cloud Shell
or pressg+s
to open the Cloud Shell using the shortcut. Alternatively, you can use the Google Cloud SDK installed on your local machine. - In the terminal, create a new directory named
Adminer
and enter the following commands to downloadAdminer version 4.8.1
and save it asindex.php
.
mkdir Adminer
cd Adminer
wget https://github.com/vrana/adminer/releases/download/v4.8.1/adminer-4.8.1.php -O index.php
To use a different version of Adminer, use the links to available versions on the Adminer Downloads page.
Step 3: Prepare the Adminer files for deployment
In the directory that you created, named Adminer
, create a new file named app.yaml
file for App Engine configuration:
- For Public IP connection to SQL server use the below
app.yaml
file.
service: adminer
runtime: php82
handlers:
- url: /.*
script: index.php
- For Private IP connection to SQL server use the below
app.yaml
file.
service: adminer
runtime: php82
handlers:
- url: /.*
script: index.php
vpc_access_connector:
name: projects/PROJECT_ID/locations/REGION/connectors/CONNECTOR_NAME
Where
PROJECT_ID
is your Google Cloud project ID,REGION
is the region your connector is in, andCONNECTOR_NAME
is the name of your Serverless VPC Access connector.
If you are deploying Adminer as the first and only application in App Engine, change the value for service from Adminer to default.
Normally, you would deploy phpMyAdmin as a service of an existing application and provide a name for the service. However, if you haven't yet deployed an application, then you are required to use the service name "default". That's fine for the purposes of this tutorial if you're trying out phpMyAdmin on App Engine.
Step 4: Deploy the application to App Engine:
Deploy the application by running the following command from within the Adminer directory where your app.yaml
file is located:
gcloud app deploy --version=VERSION_ID
Replace
VERSION_ID
with the latest version
Step 5: Log in to Adminer
Once the deployment is complete, you can access Adminer in your web browser at
https://adminer-dot-[YOUR_APP_ID].appspot.com
Step 6: Clean Up (Optional)
If you want to clean up App Engine resources after testing:
gcloud app versions delete VERSION_ID
Replace
VERSION_ID
with the version you want to delete
Conclusion
Congratulations! You have successfully deployed Adminer on Google App Engine. Access your Adminer instance by navigating to the provided App Engine URL, and start managing your databases with ease.
Feel the freedom to tailor the deployment to suit your unique specifications. Enjoy your coding adventures, and don't forget to show some love for open source!
Extend your support to the ingenious mind behind Adminer, Jakub VrΓ‘na, by contributing to the dance of creativity on Patreon. Your generosity keeps the rhythm alive!
Let's Connect!
Feel the vibe and join the conversation. Your questions, ideas, and thoughts are not just welcomed but cherished. π
βπ LinkedIn
βπ GitHub
Top comments (0)