This may or may not be what was causing the issue for you, but it just fixed it for me – although I thought I’d checked up and down, back and front, it still turned out to be a permissions issue.
In my case, it was not only mysql.user
which was reported as missing, but also mysql.columns_priv
(when I tried flushing privileges). I could use mysql
just fine, but show tables
after that gave me the following error:
ERROR 1018 (HY000): Can't read dir of './mysql/' (errno: 13 "Permission denied")
That didn’t immediately make sense to me, but it apparently means that the mysql
data directory is not readable by the _mysql
user used by the MariaDB server.
I have MariaDB running as a Homebrew service, so I looked in the MariaDB MXCL plist file (located in your Homebrew Cellar folder; for me that’s /usr/local/Cellar/mariadb/10.4.10_1/homebrew.mxcl.mariadb.plist
): under the key ProgramArguments
, there should be a --datadir
argument which specifies which directory MariaDB uses to store data. Mine is /usr/local/var/mysql
, which I’m guessing is standard.
In my case, I had previously had a regular (i.e., non-MariaDB) installation of MySQL 5.6 that had used the same data directory, which was probably the culprit – when I looked at the permissions on that directory, it was owned by my own user, and the _mysql
user only had read permissions.
Once I gave _mysql
read and write permissions on that folder, lo and behold, my mysql.user
view, along with everything else in the mysql
database, suddenly sprang into view and worked exactly as it’s supposed to.