One challenge you will face trying to connect to a PlanetScale database with Adminer is that it requires an SSL connection, which Adminer does not use by default. Not to worry, there’s a plugin for that.
- Download Adminer
- Download the login-ssl.php plugin
- Download the plugin base file
- Create a folder called
adminer
and mimic the structure below
adminer/
adminer.php
index.php
plugins/
login-ssl.php
plugin.php
- Find the path to your SSL certificate here
- Put the following inside
index.php
<?php
function adminer_object() {
include_once(__DIR__ . '/plugins/plugin.php');
foreach (glob(__DIR__ . '/plugins/*.php') as $file) {
include_once($file);
}
return new AdminerPlugin([
new AdminerLoginSsl(['ca' => 'YOUR_CERTIFICATE_PATH_HERE'])
]);
}
include './adminer.php';
- Connect to the PlanetScale database as you would a local MySQL database, except use the URL from PlanetScale as the host (ending in
psdb.cloud
)