0

I have MySql server setup on my dedicated server with an IP address 12.12.123.123 . I have configured MySql to allow remote access. Now I want to access the server from remote application. How can I do this? How will I get the host/server name of MySql to put in my connection string?

Thanks

Zach
  • 9,989
  • 19
  • 70
  • 107

2 Answers2

0

You can just put the IP address of the server as the hostname.

Make sure that

  • The mysql server is listening on the public IP, so in my.cnf:

    bind-address = 0.0.0.0
    
  • The user you configured on the mysql server is permitted to access the schema remotely:

    GRANT ALL PRIVILEGES TO `user`@% ... 
    

    To be more secure, you don't have to use the wildcard, you can use a specific host or IP pattern.

Andrew Mao
  • 35,740
  • 23
  • 143
  • 224
0

Assuming your server is fully accessible and the server instance adequately configured, you can test the connection using mysql's -h switch like so:

mysql -u username -p -h 44.55.66.77

Once this connection has been made successfully, you can use the same details in your application.

noamt
  • 7,397
  • 2
  • 37
  • 59