PHP (and by extension WordPress) only supports MySQL native & sha256 password authentication.
MariaDB Server only supports MySQL native & ed25519 password authentication.
Since MySQL native password authentication uses SHA-1 and is not considered secure anymore, there is no actual secure way to use the MariaDB server with PHP.
Am I missing something here?