title: "Can't connect to MySQL server on 'x.x.x.x' (113)", MySQL Remote Connection Stopped Working After Server Change
body: <p>Very very strange issue. So I have a website that accesses a database I have hosted on my VPS server by making a remote MySQL connection. On the VPS server I created a user with these permissions</p>
  
  <pre><code>CREATE USER 'myuser'@'%' IDENTIFIED BY 'mypassword';
  GRANT ALL PRIVILEGES ON * . * TO 'myuser'@'%';
  </code></pre>
  
  <p>Then on my website I would connect to my VPS's database like so</p>
  
  <pre><code>$vpsCon = mysqli_connect($servername, $username, $password, $dbname);
  </code></pre>
  
  <p>This was working 100% fine until I changed the hosting plan for my website. When I changed the hosting plan of my website when I try to connect to my VPS's database from my website I get the forllowing connection error</p>
  
  <pre><code>Can't connect to MySQL server on 'x.x.x.x' (113)
  </code></pre>
  
  <p>Which is very very strange being that this was working just fine before I changed my hosting plan. The only thing that changed when I changed my website hosting plan was the IP that my website is hosting on, but that shouldn't matter being that I defined the VPS's MySQL user IP address as "%".</p>
  
  <p>I've looked in my <code>my.cnf</code> because a I've found a lot of posts online saying that could be the issue but everything looks ok I think? Here's my <code>my.cnf</code> file for my VPS server that the database is hosted on</p>
  
  <pre><code>[mysqld]
  datadir=/var/lib/mysql
  socket=/var/lib/mysql/mysql.sock
  user=mysql
  # Disabling symbolic-links is recommended to prevent assorted security risks
  symbolic-links=0
  
  [mysqld_safe]
  log-error=/var/log/mysqld.log
  pid-file=/var/run/mysqld/mysqld.pid
  </code></pre>
  
  <p>I'm just so confused, I've been trying for hours to fix this but haven't been able to come up with anything, this is messing with my whole website, no one can access my website anymore because of this issue and it's driving me crazy :/ any help or information would be highly highly appreciated! Thanks for your time. </p>