Try to connect database of shopware 6 but facing issue

i dont know SQLyog, so you have to read its documentation on that.
(quick glance shows its a binary for ms-windows? in that case you propably need to allow direct mysql connections from outside, also for the mysql user…)

FWIW, heres how i install adminer on our (debian/ubuntu) vm:

mkdir /srv/adminer
curl -Lo /srv/adminer/index.php https://github.com/vrana/adminer/releases/download/v4.7.1/adminer-4.7.1.php
tee /etc/apache2/sites-available/adminer.conf <
        ServerName adminer.shopware.local
        DocumentRoot /srv/adminer
        
            Require all granted
        
    
EOF
a2ensite adminer
systemctl restart apache2

ps. i also use vagrant plugin hostsupdater to add adminer.shopware.local to hosts file on the host, so you may need to add that manually…

pps. i guess you can also do what someone did in your shopware-5 vm, copy the adminer.php to your shopware directory. (but dunno if .htaccess will rewrite your request to shopware php)