Mariadb grant access denied for user root '@' localhost

- Access denied for user 'root'@'localhost' ubuntu
- Access denied for user 'root'@'localhost' (using password yes) ubuntu
- Access denied for user 'root'@'localhost' (using password yes) xampp
- Mysql_real_connect() access denied for user 'root'@'localhost'
- Access denied for user 'root'@'localhost' (using password yes) in cpanel