Data to connect to the database in Magento are specified in the configuration file app/etc/local.xml
in lines:
<host><![CDATA[host]]></host> <username><![CDATA[login]]></username> <password><![CDATA[password]]></password> <dbname><![CDATA[base_data]]></dbname>
Changes can be made using file manager or any FTP client.