DBA Hub

📋Steps in this guide1/1

Create/drop user in mysql

##Contributed by - Vasudeva Rao Create user in mysql:

mysql configurationintermediate
by MYSQL
13 views
1

Create/drop user in mysql

View create user statements: MariaDB [(none)]> SHOW CREATE USER 'test_user'@'localhost'; Create user with password expire: Drop user:

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
mysql>
CREATE USER 'test_user'@'%' IDENTIFIED BY 'test_user';
Query OK, 0 rows affected (0.02 sec)
mysql>
GRANT ALL ON *.* TO 'user'@'localhost';
Query OK, 0 rows affected (0.01 sec)
MariaDB [(none)]>
SHOW CREATE USER 'test_user'@'%';
MariaDB [(none)]>
CREATE USER 'test_user2'@'localhost' IDENTIFIED BY 'test_user' PASSWORD EXPIRE;
Query OK, 0 rows affected (0.004 sec)
MariaDB [(none)]>
drop user 'test_user'@'localhost';
Query OK, 0 rows affected (0.009 sec)

Comments (0)

Please to add comments

No comments yet. Be the first to comment!