privilege

A MySQL add user and grant example

MySQL “users” FAQ: How do I add a new user to a MySQL database (i.e., how do I create a MySQL user account, and then grant database permissions to that new user account)?

Solution: MySQL add user and grant syntax

Here’s an example of what I did recently to (a) create a new MySQL database and then (b) add a new MySQL user account to work with that database.

Step 1: Log in to the database

First, from my Unix prompt, I logged into my MySQL database server with the mysql command line client: