After trying to upgrade mariadb to 10.2 from 5.x i got error

SYSTEM INFORMATION
OS type and version CentOS 7
Virtualmin version REQUIRED

After trying to upgrade mariadb to 10.2 from 5.x i got this error when typing this:
mysql -u root -p

ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)

pls help