Source: python – mysql error : ERROR 1018 (HY000): Can’t read dir of ‘.’ (errno: 13) – Stack Overflow
Happen when trying to connect from DBeaver on Windows to MariaDB WSL Ubuntu 22. Connection successful but cannot open the database.
You need to set ownership and permissions for directory:
chown -R mysql:mysql /var/lib/mysql/ #your mysql user may have different name
chmod -R 755 /var/lib/mysql/
Note: -R makes commands recursive – you may omit it, if there is no subdirs in /var/lib/mysql/.