Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ralphmorris's avatar

Connecting to a Digital Ocean MySQL Managed Database

Hi,

I've been looking forward to switching my apps database over to using Digital Oceans new managed mysql database service. It was simple to create and set up the trusted sources for my droplet and local IP, however, I can't connect to it from Sequel Pro or my Laravel app.

I did download TablePlus as I thought I would give it a try and it did seem to work, however, most importantly can't get my Laravel app to connect!

This is my config.

        'mysql' => [
            'driver' => 'mysql',
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'prefix_indexes' => true,
            'strict' => true,
            'engine' => null,
            'options' => extension_loaded('pdo_mysql') ? array_filter([
                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
                "sslmode" => env('MYSQL_ATTR_SSL_MODE'),
            ]) : [],
        ],

In my env file I define the extra options.

MYSQL_ATTR_SSL_CA=/home/forge/.crt/ca-certificate.crt
MYSQL_ATTR_SSL_MODE=require

However I get the following error:

The server requested authentication method unknown to the client [caching_sha2_password]")

I'm stumped. Has anybody here achieved this before?

Thanks!

Ralph

0 likes
5 replies
StanBarrows's avatar

@ralphmorris

I've the same problem. Did you maybe found any work-around for this problem?

Quote: "The caching_sha2_password authentication method will only be supported in PHP 7.4+ due to the hard dependency on ext/hash. See php/php-src@4f06e67."

ralphmorris's avatar

Unfortunately not. I ended up closing it down for the time being. I read in that thread that caching_sha2_password will only be supported from php7.4 so will probably try again when that is released unless there's another way before.

Jmac's avatar

Curious, how did this go? Are you happy with managed database once you got it working?

Please or to participate in this conversation.