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!
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.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.