Content |
MariaDB [(none)]> CREATE DATABASE hr;
Query OK, 1 row affected (0.004 sec)
MariaDB [(none)]> SELECT User, Host FROM mysql.user;
+-------------+-----------------+
| User | Host |
+-------------+-----------------+
| root | 127.0.0.1 |
| root | ::1 |
| root | desktop-bi2h0nk |
| mariadb.sys | localhost |
| root | localhost |
+-------------+-----------------+
5 rows in set (0.060 sec)
MariaDB [(none)]> CREATE USER 'hr'@'localhost' IDENTIFIED BY 'hr1234';
Query OK, 0 rows affected (0.015 sec)
MariaDB [(none)]> CREATE USER 'hr'@'%' IDENTIFIED BY 'hr1234';
Query OK, 0 rows affected (0.009 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON hr.* TO 'hr'@'localhost';
Query OK, 0 rows affected (0.011 sec)
MariaDB [(none)]> SHOW GRANTS FOR 'hr'@'localhost';
+-----------------------------------------------------------------------------------------------------------+
| Grants for hr@localhost |
+-----------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `hr`@`localhost` IDENTIFIED BY PASSWORD '*B6ED75A92ABEBC40A588FD58C11140019B8E484F' |
| GRANT ALL PRIVILEGES ON `hr`.* TO `hr`@`localhost` |
+-----------------------------------------------------------------------------------------------------------+
2 rows in set (0.008 sec)
MariaDB [(none)]> |