Unidentified 'PUBLIC' User in MariaDB on MacOS Installed via Homebrew

208 Views Asked by At

I've installed MariaDB version 11.2.2 on MacOS via Homebrew and set security settings using mariadb-secure-installation. After logging in as root and running 'select host, user from mysql.user;', I noticed a user named 'PUBLIC' with a blank host. I couldn't find any information about this 'PUBLIC' user and I couldn't delete it because the host was blank. Does anyone know what this 'PUBLIC' user is?

enter image description here

I tried searching for information about this PUBLIC user in MariaDB on Google, but I couldn't find any relevant information. To delete this PUBLIC user, I attempted to use the command DROP USER 'PUBLIC', expecting this would remove the account. However, I received the following error: 'ERROR 1396 (HY000): Operation DROP USER failed for 'PUBLIC'@'%''."

2

There are 2 best solutions below

0
drum On

PUBLIC and NONE are reserved, and cannot be used as role names. NONE is used to unset a role and PUBLIC has a special use in other systems, such as Oracle, so is reserved for compatibility purposes.

https://mariadb.com/kb/en/create-role/

0
danblack On

GRANT TO PUBLIC was added in MariaDB-10.11.

With this you can provide grants that are accessible by any authenticated user in the database. The PUBLIC in the mysql.user view is a internal representation of this user.