This topic is locked

Changing connection from remote database to localhost

5/22/2026 21:52:33
PHPRunner General questions
A
Abu author

I have build a project with connection to a remote mysql server. There are issues with delays at deployment. I will like to covert the connection to localhost. So when deployed it will recognized direct communication with mysql rather than a round trip. Changing connection from remote server address with localhost with local mirrored database did not work. dbconnection still has the old IP addresses. I have added a new localhost connection but I have troubled transfering the datasource to the localhost database table. Any suggestions? Thanks

ChatGPT 5/22/2026

Certainly! To change your PHPRunner project to use a localhost database connection instead of a remote MySQL server, you need to ensure a few things. Here’s a step-by-step approach:

  1. Create a Local Database: Ensure you have a local MySQL server running and create a mirrored version of your remote database. You can use tools like mysqldump to export the database from the remote server and then import it into your local server.


  2. Add Local Connection in PHPRunner:

    • Open your PHPRunner project.
    • Go to the Database tab.
    • Add a new connection with the following settings:
      • Server: localhost
      • Username: your local MySQL username
      • Password: your local MySQL password
      • Database: the name of your local database




  3. Change Data Source:

    • Once you have added the new connection, you need to change the data source for your tables to point to the new localhost connection.
    • In the Tables section of PHPRunner, select each table that you want to update.
    • For each table, change the connection to the new localhost connection you just created.


  4. Update settings:

    • Ensure that all queries, stored procedures, or functions that reference the remote database now point to the local database.
    • Check for any hardcoded database connection strings or queries in your project files.


  5. Verify Connection:

    • After updating the connection, test the connection to ensure that PHPRunner can communicate with your local MySQL server without any issues.


  6. Rebuild Project:

    • Once you've made the necessary updates, rebuild your project. This ensures that all changes are compiled into the final output.


  7. Test the Application:

    • Finally, run your application and check if everything is working as expected with the new localhost connection.


  8. Check Configuration Files:

    • If the changes are not reflected, check if there are configuration files or additional settings that might be overriding your connection settings.



If you follow these steps and ensure that the data source for each table is correctly set to the new localhost connection, it should work. If you continue to face issues, consider checking for any caching issues or looking into the logs for any errors that might indicate what is going wrong.

A
Abu author 5/22/2026

The trouble is at step 3, the localhost databases and its related tables were not showing up in the drop down menu.

changedatabase.png