MariaDB(10.4.11) Permission Issues on OSX Catalina (10.15.3)
I'm setting up a new machine for development w/ OS X Catalina (10.15.3) and having issues with MariaDB/MySQL permissions. I installed Homebrew and then installed the MariaDB package. After logging in using mysql -uroot
, I get the following error when trying to create a database:
➜ ~ mysql -uroot Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 12 Server version: 10.4.11-MariaDB Homebrew Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> create database anything_db; ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'anything_db'
where 'anything_db' is any database that I try to create. From reading the error, it looks like it's interpreting my command as being run from not root, but instead an anonymous user (I think that's what '' means in that context). However, when I run status at the MySQL command prompt, it outputs the following:
MariaDB [(none)]> status -------------- mysql Ver 15.1 Distrib 10.4.11-MariaDB, for osx10.15 (x86_64) using readline 5.1 Connection id: 12 Current database: Current user: root@localhost SSL: Not in use Current pager: less Using outfile: '' Using delimiter: ; Server: MariaDB Server version: 10.4.11-MariaDB Homebrew Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: utf8mb4 Db characterset: utf8mb4 Client characterset: utf8 Conn. characterset: utf8 UNIX socket: /tmp/mysql.sock Uptime: 18 hours 5 min 23 sec Threads: 7 Questions: 25 Slow queries: 0 Opens: 16 Flush tables: 1 Open tables: 10 Queries per second avg: 0.000 --------------
This seems to suggest it's registering me being logged in as root@localhost but that is not what the previously listed error seems to suggest. Is it a permissions related error? I don't think I missed any sudo prefixes while going through the installs, but it seems like that could be related.
This has always "just worked" for me when setting up/re-formatting my dev machines so this is my first time having to dig in. Any help is great appreciated and let me know if any more info would be helpful. Thanks in advance for any advice!