Cannot login to MariaDB server with root account

Problem

You are trying to login to MariaDB with the root user, but even after resetting the password, it is still not possible to login.

Solution

It seems that certain MariaDB packages that come with Linux distributions use the unix_socket as the authentication method.

MariaDB [mysql]> SELECT user, host, plugin FROM user WHERE user='root';
+------+-----------+-------------+
| user | host      | plugin      |
+------+-----------+-------------+
| root | localhost | unix_socket |
+------+-----------+-------------+
1 row in set (0.00 sec)

Change the plugin as described here (https://stackoverflow.com/a/43424234) with the following:

MariaDB [mysql]> UPDATE mysql.user SET plugin = '' WHERE user = 'root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

Get a list of directories with user permissions

Problem

You want to run a command in a hosted server but you don’t have su permissions. There are directories that have different owners/permissions, so you would like to see them.

Solution

Use the tree command and save the output in a file if you have many directories:

tree -pufid /home/directory_to_check > /home/user/permissions.txt

taken from the answer here: https://unix.stackexchange.com/a/82374