In the fresh installation of Mysql MariaDB for default is not possible to use user root for access localhost, so you have to give permission for that, let’s go.
Assign a new password for root in mysql mariadb.
mysql -u root -p
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '';