In a few circumstances, you may have to connect the MySQL Database from the local machine to the web hosting server, following is the script you can use for the same. Remember you need to have the following information with you

1. Database URL and
2. Java applet – ‘com.mysql.jdbc.Driver’ – to connect it.

Now you can use the following script to connect the MySQL database which is hosted remotely.

<!- Database connection settings ->
<property name=”connection.driver_class”>com.mysql.jdbc.Driver</property>
<property name=”connection.url”>jdbc:mysql://localhost[serverIP ]/database_name</property>
<property name=”connection.username”>databses_user</property>
<property name=”connection.password”>password</property>
<!- configuration pool via c3p0->