How to Connect multiple database in WordPress?

Yes you can do anything with PHP :grinning: but what is your purpose.
You could just create another config.php file and connect from there?

Example below is calling the table $mycities from $wpdbtest_otherdb

$wpdbtest_otherdb = new wpdb('myaccount_cityuser', 'mypassword', 'myaccount_cities', 'localhost');
$wpdbtest_otherdb->show_errors();
$mycities = $wpdbtest_otherdb->get_results("SELECT name
                                            FROM city
                                            WHERE city.stadium = 1");
foreach ($mycities as $mycity) {
    echo $mycity->name . '<br />';
}

Although the above example is dirty and not the most secure yet would call the data from the other DB as you might needโ€ฆ

PS Be more precise in your question.