What are the potential security risks of leaving phpMyAdmin accessible on a domain and how can it be secured?

Leaving phpMyAdmin accessible on a domain can pose security risks such as unauthorized access to the database, potential SQL injection attacks, and exposure of sensitive information. To secure phpMyAdmin, it is recommended to restrict access by IP address, use strong passwords, enable SSL encryption, and regularly update the software to patch any security vulnerabilities.

$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow';
$cfg['Servers'][$i]['AllowDeny']['rules'] = array(
    'deny root from all',
    'allow root from localhost',
    'deny all from all'
);