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:
-
creating user with user name: jpa
create user 'jpa'@'localhost' identified by 'jpa';
-
granting privileges to database jpa and all its tables
grant all on jpa.* to 'jpa'@'localhost';
-
flushing privileges
flush privileges;
After that 'jpa' database is accessible for 'jpa' user.