Content

Board ID 1218
Writer 허진경 (나자바바)
Write Date 2023-05-22 17:56:55
Subject MariaDB에 hr 데이터베이스와 hr 사용자 만들기
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)]>