Comments - Cannot reset password for the root user in MariaDB (Mac keeps changing it on restart)
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
I can't help with Mac specifically, but take a look at Troubleshooting Connection Issues, in particular Authentication from MariaDB 10.4.
Note that if you're using any of the currently maintained versions (MariaDB 10.5+), the name of the binaries will be mariadb*, not mysql*
If you're still having problems, provide the version you're using, and, when you first install and have access, the contents of the global_priv table:
Further reading:
Ok, let me answer your questions:
1. provide the version you're using
2. when you first install and have access, the contents of the global_priv table:
```sh $ sudo mysql -uroot Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 15 Server version: 11.4.2-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)]> SELECT CONCAT(user, '@', host, ' => ', JSON_DETAILED(priv)) FROM mysql.global_priv; +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | CONCAT(user, '@', host, ' => ', JSON_DETAILED(priv)) | +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | mariadb.sys@localhost => { "access": 0, "plugin": "mysql_native_password", "authentication_string": "", "account_locked": true, "password_last_changed": 0 } | | root@localhost => { "access": 18446744073709551615, "plugin": "mysql_native_password", "authentication_string": "invalid", "auth_or": [ { }, { "plugin": "unix_socket" } ] } | | victorcosta@localhost => { "access": 18446744073709551615, "plugin": "mysql_native_password", "authentication_string": "invalid", "auth_or": [ { }, { "plugin": "unix_socket" } ] } | | PUBLIC@ => { "access": 0, "is_role": true } | | @localhost => { } | | @victors-macbook-pro.local => { } | +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 6 rows in set (0.002 sec) ```3. Also, let me show here the list of the users and the local passwords, because some of these passwords are `invalid`, which is weird.
I formatted your output for you :)
"Invalid" as a password means that password authentication is disabled. See Authentication from MariaDB 10.4.
"some users may wish to log in as MariaDB root without using sudo. Hence the old authentication method — conventional MariaDB password — is still available. By default it is disabled (“invalid” is not a valid password hash), but one can set the password with a usual SET PASSWORD statement."