title: how to connenct remote mysql connection in cpanel
body: <p>I am trying to connect MySQL database remotely from my local pc since 2 weeks but I failed . www.hdvoiz.com this is where I created my database and I am using Cpanel admin panel . please help me .</p>
  
  <ul>
  <li><p>here is the Error msg</p>
  
  <p>java.sql.SQLException: Access denied for user 'hdvoiz_user'@'95.218.172.137' (using password: YES)</p></li>
  <li><p>here is my code</p>
  
  <p>package rmotedb;</p>
  
  <pre><code>import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.SQLException;
  
  public class Main {
  
  public static void main(String[] args) {
      System.out.println("-------- MySQL JDBC Connection Testing ------------");
  
      try {
      Class.forName("com.mysql.jdbc.Driver");
       } catch (ClassNotFoundException e) {
  
      System.out.println("Where is your MySQL JDBC Driver?");
          e.printStackTrace();
          return;
      }
  
      System.out.println("MySQL JDBC Driver Registered!");
      Connection connection = null;
  
      try {
          String url = "jdbc:mysql://hdvoiz.com:3306/hdvoiz_loy";
          String username = "hdvoiz_user";
          String password = "**********";
      connection = DriverManager.getConnection(url, username, password);
  
      } catch (SQLException e) {
          System.out.println("Connection Failed! Check output console");
          e.printStackTrace();
          return;
      }
  
      if (connection != null) {
          System.out.println("You made it, take control your database now!");
      } else {
          System.out.println("Failed to make connection!");
      }
      }
  
  }
  </code></pre></li>
  </ul>