Yes, it can be done.
Find out the IP address of server A where your scripts will be downloaded. Remember to change localhost to the IP address of server B in the mysql_connect () or mysqli_connect () method.
Now go to the server control panel B, where your database is located.
On the main page of the control panel, go to the "Databases" section and click the "Remote MYSQL" button.
Then add the IP address of server A and click on add host.
Now you can access the database on server B while your scripts are running on server A. Keep in mind that the result will be slow because it receives data from a database located on another server.
Your greeting
source share