MariaDB 10.6にユーザーを作成する

環境
Windows 10 64bit
MariaDB 10.6.4

書式1
CREATE USER ユーザー名
※指定しパスワードなし

操作例
MariaDB [(none)]> create user cft;
Query OK, 0 rows affected (0.326 sec)

書式2
CREATE USER ユーザー名 IDENTIFIED BY 'パスワード’

操作例
MariaDB [(none)]> create user cft01 identified by '12345#’;
Query OK, 0 rows affected (0.040 sec)

書式3
create user 'ユーザー名’@’ホスト名’ identified by 'パスワード’
操作例
MariaDB [(none)]> create user 'cft02’@’localhost’ identified by '2345@’;
Query OK, 0 rows affected (0.023 sec)

作成済みのユーザーの一覧を確認します

MariaDB [(none)]> select user,host from mysql.user;
+-------------+-----------------+
| User        | Host            |
+-------------+-----------------+
| arkgame22   |  172.20.10.4    |
| arkgame03   | %               |
| cft         | %               |
| cft01       | %               |
| root        | %               |
| root        | 127.0.0.1       |
| root        | ::1             |
| root        | desktop-2nbj8il |
| arkgame22   | localhost       |
| cft02       | localhost       |
| mariadb.sys | localhost       |
| root        | localhost       |
+-------------+-----------------+
12 rows in set (0.001 sec)

 

MariaDB

Posted by arkgame