Posted in MySQL, MySQL Shell

Create New User with admin rights on MySQL Shell

Creating new user through MySQL Shell commands below, grant access to the user then connect to MySQL (through Workbench or Shell) with that user:

MySQL JS> \sql

MySQL JS> \connect root@localhost

 

Then enter password and Y (to save the password). Or root@{ip address or hostname).

 

MySQL  localhost:33060+ ssl  SQL >  CREATE USER ‘user’@’serverhostname’ IDENTIFIED BY ‘password’;

MySQL  localhost:33060+ ssl  SQL >  GRANT ALL PRIVILEGES ON *.* TO ‘user’@’serverhostname’ WITH GRANT OPTION;

MySQL  localhost:33060+ ssl  SQL >  CREATE USER ‘user’@’%’ IDENTIFIED BY ‘password’;

MySQL  localhost:33060+ ssl  SQL > GRANT ALL PRIVILEGES ON *.* TO ‘user’@’%’ WITH GRANT OPTION;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s