Below shows you the syntax required to assign a user (along with password) to a MySQL database.
This is useful for assigning separate permissions across your databases rather then just assigning root access across the board.
mysql> GRANT ALL ON <DATABASE>.* TO <USERNAME>@localhost IDENTIFIED BY '<PASSWORD>';
Latest posts by Rick Donato (see all)
- NETCONF & YANG: Automate Network Configs via Python - April 2, 2026
- Palo Alto – How to Configure Your Next-Generation Firewall - April 2, 2026
- How to Harden Linux SSH: Keys, Fail2ban & Ciphers - March 1, 2026
Want to become a database expert ?
Here is our hand-picked selection of the best courses you can find online:
Ultimate MySQL Bootcamp
Complete SQL Bootcamp
MongoDB Complete Developer course
and our recommended certification practice exams:
Delta Practice Tests