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

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:

 
7 hours, 59 minutes 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 © 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; +---------------------------+-------------+----------+

HostUserPassword

+---------------------------+-------------+----------+

localhostmariadb.sys
localhostrootinvalid
localhostvictorcostainvalid
PUBLIC
localhost
victors-macbook-pro.local

+---------------------------+-------------+----------+ 6 rows in set (0.001 sec) ```

 
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.