I have hosting provided by eleven 2 and I just created a new MySQL user and gave it access to every action listed.
I\'m getting the following error
I had same issue, I was trying to connect between two different Web Servers. If I use my PHP script on same server the connection will establish but if I use the same script file from other Web Server (Web Hosting) it gave this error.
I solved it by allowing access to MySQL Server (Remote MySQL) by providing the IP address from where I used to connect.
it is also worth noting that I used Domain but Domain Name did not work for me. Also both CPanel and itself MySQL users could connect to MySQL Server. Hope its helpful for you also.