MyJgui logoCross-platform graphical MySql client/front-end

How to create user in mysql (simple example)

Create user :

This is simple example, how to create user in msyql database and provide privileges to work with specified database.

To allow new user to login and work, 3 steps are necessary:

  1. creating user with user name: jpa

    create user 'jpa'@'localhost' identified by 'jpa';

  2. granting privileges to database jpa and all its tables

    grant all on jpa.* to 'jpa'@'localhost';

  3. flushing privileges

    flush privileges;

After that 'jpa' database is accessible for 'jpa' user.