laracastsluvr's avatar

Digital Ocean managed databases

Hello, again friends!

Did anyone play with Digital Ocean's Managed Databases? Particularly with MySQL 8. If so, care to share some configuration?

Thanks.

0 likes
1 reply
mattsplat's avatar
Level 8

I was able to connect by manually setting the user to use native password ALTER USER use_your_user IDENTIFIED WITH mysql_native_password BY 'use_your_password';. I connected first using a my database client DataGrip then ran that command. I'm sure you could do this from command line as well but I couldn't connect using Sequel Pro. You can find instructions here https://www.digitalocean.com/docs/databases/mysql/resources/troubleshoot-connections/

Then in my .env I added a line for

MYSQL_ATTR_SSL_CA="/full/path/to/ca-certifcate.crt" 
SSL_MODE=required

Then in config/database.php I added under mysql

'ssl_mode' => env('SSL_MODE'),

After that run php artisan config:cache and you should be able to connect

Please or to participate in this conversation.