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:
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.Replace
'read_only_user'
with the username that you used in the previous step and also replaceyour_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:
Happy coding! 🚀
- Bobby
Heya,
I think you can follow these articles to achieve what you are looking for: