popkutt
popkutt

Reputation: 1019

MySQL external access for localhost

I need to connect a desktop application to a MySQL server. The website connect to the database 'localhost'. What would the the full path of the localhost be?

Using CentOS 6.5/apache/zpanel

The answer is probably so obvious that nobody has ever asked it before. But I rally can't figure it out. Here is the screenshot of what I have:

enter image description here

Upvotes: 0

Views: 88

Answers (2)

Jorge Campos
Jorge Campos

Reputation: 23371

You have to grant access to the user you are using to connect from remote, on your case the root user so:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'
  IDENTIFIED BY 'password' WITH GRANT OPTION;

After this run this other command to refresh the new privileges

FLUSH PRIVILEGES;

The '%' is the option that you allow root to connect from anywhere. You can specify also an IP address.

Upvotes: 1

the_nuts
the_nuts

Reputation: 6054

It's the IP address of the server which is running mysql (the same of the webserver, if you're connecting to it as localhost)

But many hosting companies disable remote MySQL by default, you may need to ask them to enabled it, or to whitelist the IP you are connecting from.

Upvotes: 1

Related Questions