Question
Has anyone been able to use managed MySQL?
I tried to use Digital Ocean’s new managed MySQL but users I create use cachingsha2password authentication which the Node mysql client doesn’t support. DigitalOcean support told me to run
ALTER USER myuser IDENTIFIED WITH mysql_native_password BY 'mypassword';
but I got a permissions error, apparently I don’t have permission to run that on their MySQL cluster.
So, is their new managed MySQL offering 100% useless for anyone wanting to use it with Node?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
Edit…sorry…I can run that
ALTER USER
command but it has no effect unless I then runFLUSH PRIVILEGES
which I don’t have permission to do on the cluster.@tsongas Have you ever been able to resolve it? I think I’ve tried every possible solution for 2 days but I am still not able to connect to the managed database.
@tsongas @ReneH I am also very interested, as I have been stuck on this for a few days now.
@bake1 I was able to solve it by updating PHP to at least PHP 7.2+
Even after updating make sure that your web app runs under that version by using phpinfo(); In my particular case it turned out that my website still used PHP 7.0 because I’ve “overlooked” to modify the nginx.conf of my server.
@ReneH I was able to get it working as well.
I fixed it by:
1) changing my db user with ‘ALTER USER myuser IDENTIFIED WITH mysqlnativepassword BY 'mypassword’;’
1a) using the new 'mypassword’ in my .env file when connecting to the db from my application
2) upgrading node to 12
3) making sure I included my droplet’s ip address in the list of trusted sources for my managed database.
Thanks for the response