0

I'm trying to connect to my MySQL database using Sequel-Pro and I'm kinda confused what to use as my host. My hosting provider only gave me 'localhost' as my host then some user and password.

enter image description here

Pennf0lio
  • 3,888
  • 8
  • 46
  • 70

3 Answers3

1

Typically you cannot connect remotely to DB a hosting provider will give you. There are a few that allow, but on shared environments (Dreamhost for example) but generally they wont allow you to as it is a potential security issue.

What sequel thinks you are trying to do is connect to your local computer (which localhost and 127.0.0.1 should resolve to). IF you are trying to connect to the remote DB of your hosting provider then you would need the public IP address or domain name of their DB server, not localhost.

If your provider does not offer remote DB access but does offer SSH access, you can use the SSH tunnel option in SequelPro to connect your host over SSH and then access your DB over that connection.

Bitmap
  • 12,402
  • 16
  • 64
  • 91
prodigitalson
  • 60,050
  • 10
  • 100
  • 114
1

Sorry localhost is your local machine which is lookup on 127.0.0.1. Contact your provider again to acquire the correct host or IP address of the server hosting the MySQL engine. If they require you to connect via SSH, ask them for the right connection details and instruction.

Bitmap
  • 12,402
  • 16
  • 64
  • 91
1

I would assume that the hostname "localhost" is referring to the database from the application running on your hosting providers system.

If you use localhost from your own computer it will try to connect to a local database, on your own computer. (localhost is just a hostname translated to 127.0.0.1 by the hosts-file on your system)

You need to have a valid hostname for the database, please ask your provider if you can access the database from a external host and have them send you a real hostname.

Dean
  • 96
  • 3