# How to create a read-only user for your database? If your app is about searching (business directories, dictionaries, etc) or a catalog of browsable items, it’s always a good idea to let your API use a read-only database user. Another use case would be for doing backups, no write permissions needed either. Here is how to do that for PostgreSQL v9.0+ (syntax quasi-similar for MySQL): ```sql -- Say we just created the user "pouet" -- Allow the user to CONNECT GRANT CONNECT ON DATABASE mydb TO pouet; -- Allow the user to SELECT GRANT USAGE ON SCHEMA public TO pouet; GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO pouet; GRANT SELECT ON ALL TABLES IN SCHEMA public TO pouet; ``` You can then check the user’s permission with: ``` mydb=# \du+ pouet ```