I want to create a user whom has only read access to Digital Ocean’s managed DB. How can I do that.
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.
Hey there!
You should be able to do that by following the official DigitalOcean documentation here:
For the read-only user, you would need to make sure that you only grant read-only privileges:
First, you’ll need to create the user in your MySQL database:
After that revoke all of the default privileges for that new readonly user:
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'readonly'@'%';
Next, grant the necessary privileges for read-only access. The SELECT privilege is all you need to give them the ability to read from the database.
GRANT SELECT ON your_database.* TO 'read_only_user'@'%';
Replace 'read_only_user' with the username that you used in the previous step and also replace your_database with the name of the database you want the user to access.
To ensure that the new privileges take effect, run the following command:
FLUSH PRIVILEGES;
Happy coding! 🚀
- Bobby
Heya,
I think you can follow these articles to achieve what you are looking for:
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.
