Skip to content

Latest commit

 

History

History
 
 

task-003-create-user

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
  • Create a user
mysql> CREATE USER 'app_user'@'%' IDENTIFIED BY 'somepassword';
Query OK, 0 rows affected (0.07 sec)
  • Get the list of users and corresponding hosts allowed to login
mysql> select user,host from mysql.user;
+-------------------+-----------+
| user              | host      |
+-------------------+-----------+
| admin             | %         |
| app_user          | %         |
| mysql.infoschema  | localhost |
| mysql.session     | localhost |
| mysql.sys         | localhost |
+-------------------+-----------+
5 rows in set (0.06 sec)
  • Give READONLY priviledge to login
mysql> GRANT SELECT, SHOW VIEW ON *.* TO 'app_user'@'%';
Query OK, 0 rows affected (0.09 sec)
  • Drop the user
mysql> DROP USER 'app_user'@'%';
Query OK, 0 rows affected (0.07 sec)