MariaDB 10.6にホスト名を変更する
環境
Windows 10 64bit
MariaDB 10.6.4
書式
RENAME USER ユーザ名@ホスト名 to ユーザ名@新ホスト名
使用例
1.登録されているユーザーを確認します
MariaDB [(none)]> SELECT user, host FROM mysql.user where user='arkgame03'; +-----------+-----------+ | User | Host | +-----------+-----------+ | arkgame03 | localhost | +-----------+-----------+ 1 row in set (0.001 sec)
2.ホストを%に変更します
MariaDB [(none)]> RENAME USER arkgame03@localhost to arkgame03@'%'; Query OK, 0 rows affected (0.083 sec)
3.ホスト名変更後確認
MariaDB [(none)]> SELECT user, host FROM mysql.user where user='arkgame03'; +-----------+------+ | User | Host | +-----------+------+ | arkgame03 | % | +-----------+------+ 1 row in set (0.001 sec)