When I access phpMyAdmin from GoDaddy it says the server is localhost:3306 and therefore can only connect to mySQL using localhost as servername. Should the server be my websites url or ip address? Do I need to set it up?
No, you do not need to set it up. The fact that it is showing localhost:3306 in GoDaddy simply shows that it's on the same server with your hosting package.
If you're connecting to this MySQL instance from PHP, you would connect to "localhost" as the server address. No port should be necessary as 3306 is default for MySQL.
No, the server should not be set up to use your websites url or IP address, as having it at localhost in essence does that. It's on the same server AS your website.
Does that make sense?
Related
My hosting site provided me phpMyAdmin on server's localhost. How to connect remotely to MySql using remote tool as Session Manager or MySql Workbench.
When i work database in my website i use hostname as localhost. So question is what to fill in hostname in workbench. I already tried hosting site ip address, but couldnt connect with database.
A screenshot
From the figure, you shared I can see you are using HeidiSQL software to connect with a remote MySQL server. Hostname/IP should be your hosting IP address provided by your hosting provider. You need to verify the port where your MySQL is running. Here you have set 3306 which is the default port. It could run on a different port. In the User and Password fields, you should use your username and password to login into your hosting server.
i have configured the phpmyadmin's config.inc.php file and a drop down menu has appeared accordingly in localhost/phpmyadmin to select the server. But when i try to connect to the server it says:
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
i have added my ip address to the online host server in the cpanel and have access to the remote sql connection.
please help.
Most hosts block incoming connections to the MySQL server as a security measure. You'll have to ask your host about unblocking port 3306 and how to access your MySQL directly -- or run an API on your web host, which would have access to the MySQL server due to being on the same network, and access the database through that. For phpMyAdmin specifically, just install it on your web host instead of your local machine, then access it through the internet rather than localhost.
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.
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.
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.
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.
I am setting up CakePHP for the first time in order to develop the server side of the website I'm building. I already have a database set up on a remote server. So I want CakePHP to connect to that server. That's not working. I get a notice "Cake is NOT able to connect to the database."
I've tried changing the settings in cake\app\database.php:
persistent: true or false
host: with or without prefix 'http://'
But none of that helps. All the examples I've seen have server set to 'localhost'.
Can anyone tell me if cakePHP can connect to a remote db? Or am I completely missing the point and should I be using the mysql server included in my WAMP set?
You have 2 options
Option 1
Your webhost needs to allow connections to the mysql instance from outside the local network.
Check the manuals for the webhost if you're allowed to change the mysql configuration yourself you may be allowed to accept incoming connections.
Your method only works when the host accepts incoming connections on for example port 3306 which is the default mysql port.
Option 2
If you have SSH access to the remote host, you're able to set up a tunnel.
Which would make you connect to the Mysql Instance though your SSH connection on a local port.
One way you could do this is by using PuTTY.
How to set up a MySQL tunnel in PuTTY
Initiate the connection and keep it alive.
Use the host 127.0.0.1 and port 3306 in your CakePHP Database config.
Username & Password would be your MySQL User Credentials
this might sound stupid, but i never experienced such thing, im developing on my localhost, but i have my server with 1 and1, how can i connect to my database on my server using my localhost, what will the host be? thanks
Try just using the string "localhost" as the hostname or the IP address if you know it.
If that doesn't work you could contact the 1 & 1 customer support.
host will be localhost or 127.0.0.1(This is IP address for localhost). I hope it will work
First, make sure that mysql is actually listening on localhost (127.0.0.1).
You may be connecting over your public IP.
If you want to test running mysql only on localhost, this quick howto shows you
what to put in your /etc/my.cnf
Use 'localhost' as your host when connecting between db and localhost. In connecting your server to your database, follow the instructions from your localhost server website.