Creating a read-only database user in MySQL

We typically recommend that you create a read-only trevor database user that Trevor can connect as.  You can do this easily by running the below commands against your MySQL database:

-- STEP 1. Create user with password 
CREATE USER 'trevor' IDENTIFIED BY your_secure_password;
-- STEP 2. Ensure that the user has strictly read-only privileges
GRANT SELECT, SHOW VIEW ON database_name_you_want_to_connect_to_trevor.* TO 'trevor';

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request



Please sign in to leave a comment.