2808 explained code solutions for 75 technologies


mysqlCreate user with full access to single database


CREATE USER [email protected] IDENTIFIED BY 'pwd';
GRANT ALL PRIVILEGES ON db.* TO [email protected];
FLUSH PRIVILEGES;ctrl + c
CREATE USER

creates specified user

[email protected]

user name and host to attach it to

GRANT ALL PRIVILEGES

grants any operation for specified user

ON db.*

database tables (all tables of db database in our case) we want our user to have access to

TO [email protected]

user we want to grant access to (our newely created user)

IDENTIFIED BY 'pwd'

set pwd password for our user

FLUSH PRIVILEGES

will make sure new user access is granted instantly