1

I've created a database using phpmyadmin. Now I'm trying to connect that database using terminal with the following command :

mysql -h server.com -u xyz -p

but after giving password. It's returning the following error :

ERROR 1045(28000) : Access denied for user 'database_name'@' IP ADDRESS' (using password : yes)

I've contacted with my hosting provider. They suggested me to white list my IP address from CPanel. I've already done that. But still I'm getting this error.

How can I overcome this issue and connect to a database to a remote server?

tuxtu
  • 121
  • 5
  • 1
    Possible duplicate of [grant remote access of MySQL database from any IP address](https://stackoverflow.com/questions/8348506/grant-remote-access-of-mysql-database-from-any-ip-address) – Jerodev Jun 19 '17 at 14:32
  • Does `...........` contain a user and host combination that exists in your user list? – Álvaro González Jun 19 '17 at 14:33
  • @ÁlvaroGonzález thanks for pointing that, I've made necessary edits. Hope that'll help you to understand the issue. – tuxtu Jun 19 '17 at 14:38
  • Did you check this? https://stackoverflow.com/questions/10299148/mysql-error-1045-28000-access-denied-for-user-billlocalhost-using-passw – behkod Jun 19 '17 at 14:38
  • Well, you need to grant permissions to either `database_name@IP ADDRESS` or `database_name@%`. – Álvaro González Jun 19 '17 at 14:39
  • @ÁlvaroGonzález, then how should I write the command : "mysql -h .... -u database name@IP -p" – tuxtu Jun 19 '17 at 14:42
  • You need to grant access from whatever administration tool you have, not fake the authentication data. – Álvaro González Jun 19 '17 at 14:44
  • @ÁlvaroGonzález should I grant access from phpmyadmin? I've created the database from there. – tuxtu Jun 19 '17 at 14:47
  • I've connected successfully. I was giving the wrong IP address :( – tuxtu Jun 19 '17 at 15:47

0 Answers0