After you put the shell on a site such as using the way sql injection techniques, Local file inclusion or Remote File Inclusion, Then You want to read another config in it's server access with Shell Jumping / PHP script which might be readable in / public / html. So after you get access to readable sites on the server you can read or jump to the config file and connect...