Users and permissions
Create least-privilege accounts and keep credentials out of the codebase.
What you will be able to do
- Create a dedicated user for each app.
- Grant only SELECT/INSERT/UPDATE/DELETE as needed.
- Use strong passwords and rotate them.
- Restrict connections to known hosts.
In plain English
MySQL grants are explicit: a user gets privileges on specific databases or tables. Create a separate user per application and grant only what it needs. Never let the web app connect as root.
CREATE USER 'edubyte_app'@'%' IDENTIFIED BY 'replace-with-a-secret';
GRANT SELECT, INSERT, UPDATE, DELETE ON edubyte.* TO 'edubyte_app'@'%';
FLUSH PRIVILEGES;Your turn
EasyGrant read-only access
Grant SELECT on the edubyte database to a reporting user.
SQL · starter
GRANTCheck your understanding before moving on.
Knowledge checkQuestion 1
Which host pattern allows a user to connect from anywhere?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.