title: Why can't I connect to my DB
body: <p>I've  set  up an apache2 ubuntu server on AWS, I  create a mySQL db in said server, now  I'm trying to update the database from my android application but its  not  connecting.</p>
  
  <p>This is the PHP file in the server side which should connect to the db. </p>
  
  <pre><code>&lt;?php
   define('HOST','ec2-54-171-67-69.eu-west-1.compute.amazonaws.com');
   define('USER','root');
   define('PASS','password');
   define('DB','ugproject');
  
   $con = mysqli_connect(HOST,USER,PASS,DB) or die('Unable to Connect');
   ?&gt;
  </code></pre>
  
  <p>This is the Java method.</p>
  
  <pre><code>private static final String REGISTER_URL = "ec2-54-171-67-69.eu-west-1.compute.amazonaws.com/volleyRegister.php";
   private void registerUser(){
          final String username = editTextUsername.getText().toString().trim();
          final String password = editTextPassword.getText().toString().trim();
          final String email = editTextEmail.getText().toString().trim();
  
          StringRequest stringRequest = new StringRequest(Request.Method.POST, REGISTER_URL,
                  new Response.Listener&lt;String&gt;() {
                      @Override
                      public void onResponse(String response) {
                          Toast.makeText(MainActivity.this,response,Toast.LENGTH_LONG).show();
                      }
                  },
                  new Response.ErrorListener() {
                      @Override
                      public void onErrorResponse(VolleyError error) {
                          Toast.makeText(MainActivity.this,error.toString(),Toast.LENGTH_LONG).show();
                      }
                  }){
              @Override
              protected Map&lt;String,String&gt; getParams(){
                  Map&lt;String,String&gt; params = new HashMap&lt;String, String&gt;();
                  params.put(KEY_USERNAME,username);  
                  params.put(KEY_PASSWORD,password);  
                  params.put(KEY_EMAIL, email);  
                  return params;
              }
  
          };
  
          RequestQueue requestQueue = Volley.newRequestQueue(this);
          requestQueue.add(stringRequest);
      }
  </code></pre>
  
  <p>This is the error I get:</p>
  
  <pre><code>E/Volley: [126] BasicNetwork.performRequest: Unexpected response code 412 for http://ubuntu@ec2-54-171-67-69.eu-west-1.compute.amazonaws.com/volleyRegister.php       
  </code></pre>
  
  <p>I've tried to be as clear as possible feel free to ask for any more info, thanks.</p>