2808 explained code solutions for 75 technologies


mysqlCreate user with root privileges


CREATE USER [email protected] IDENTIFIED BY 'pwd';
GRANT ALL PRIVILEGES ON *.* TO [email protected] WITH GRANT OPTION;
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 *.*

allow access to all tables of all databases

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

WITH GRANT OPTION

allow user to grant access to other users