Comments - Cannot reset password for the root user in MariaDB (Mac keeps changing it on restart)

 
1 month, 2 weeks ago Marko Mäkelä

I suspect that this may be related to the bug MDEV-34422, which causes InnoDB to write corrupted write-ahead log on IBM AIX as well as Apple macOS.

 
2 months, 1 week ago Ian Gilfillan

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:

SELECT CONCAT(user, '@', host, ' => ', JSON_DETAILED(priv)) FROM mysql.global_priv;

Further reading:

 
1 month, 4 weeks ago Victor Costa

Ok, let me answer your questions:

1. provide the version you're using

```sh
$ mariadb --version
mariadb from 11.4.2-MariaDB, client 15.2 for osx10.19 (arm64) using  EditLine wrapper
```

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.

```sh
MariaDB [mysql]> select Host, User, Password from user;
+---------------------------+-------------+----------+
| Host                      | User        | Password |
+---------------------------+-------------+----------+
| localhost                 | mariadb.sys |          |
| localhost                 | root        | invalid  |
| localhost                 | victorcosta | invalid  |
|                           | PUBLIC      |          |
| localhost                 |             |          |
| victors-macbook-pro.local |             |          |
+---------------------------+-------------+----------+
6 rows in set (0.001 sec)
```
 
1 month, 4 weeks ago Ian Gilfillan

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."

 
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.