Hi, Every time I try to add database env variables and save them or try to attach an existing mysql db cluster to my Laravel app I get the following error:
error validating databases field "databases.cluster_name": database cluster (app-05a5d26c-501c-4c4c-8921-32d57a9d2145)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Hi there,
In order to be able to use those environment variables, you would first need to attach your Managed MySQL database clsuter to your app. Can you confirm if you’ve done this already?
If not, in the Apps section of the DigitalOcean Control Panel, click your app, then click the Create dropdown. Add a database resource by choosing the Create/Attach Database option. If you already have a database cluster, you can attach it to your app.
After that, based on the name that you’ve specified, you will be able to access your database env details using the
db.USERNAME
,db.PASSWORD
, etc. syntax.Let me know how it goes!
Best,
Bobby