I setup a remote database server on digital ocean. I use this server to connect different VPS to this server and save the data separately. This works very well. But I do not know how to connect properly via sequelPro to this server now, as I needed to adjust the my.cnf file on the server to adjust the bind address.
When I set the bind_address to 127.0.0.1 I can connect perfectly well to the server via this config:
But if I do this, I cannot connect anymore to the remote server from my other droplet, as the server IP of the DB VPS is now set to 127.0.0.1 and not to the remote server IP address.
How can I fix this?
You can bind it to 0.0.0.0 which binds to all addresses. Change the default port number to something large that people would keep guessing and that should help.
Also security is determined by the way you harden your application which is your database server. As long as you have strong password that should take care of your security concerns.
Related
i'm trying to connect to a CPanel database on a remote server from my Laptop's SequelPro, it's not working and i have no idea why, i've set the remote access to be the '%' wildcard, so my specific machine shouldn't matter
I'm using the domain name of the site and i've used the correct username and password for a user i created on my CPanel's DB... what am i doing wrong? Or am i overlooking some detail?
It should just login with the domain and user credentials right?
Please ask your hosting providers if they do allow remote mysql connections to their mysql server. Most of the providers don't. You could test that by doing a telnet connection on the mysql server's ip address, portt 3306.
telnet mysql-server-ip 3306
If you can connect then they do allow incoming mysql connections from the internet to their server. If not, then there is nothing you can do. Just write them, explain your problem and see what they say.
Login to cPanel and go to MySQL Databases. Check if there's any remote mysql server shown there. If not, most probably the MySQL runs locally on the cPanel server the mysql server ip = the cPanel server ip. If you go to
cPanel -> Remote MySQL you can add there your ip address or the ip you're connecting to. That might fix your issue...
Well, first off, I am no programmer. I am a medstudent with decent computer knowledge, and that has done this at least one time before in his home network.
Now, i am doing some research at the hospital, and for my database i want to use mysql, running a server on a local network computer and being able to connect to it from laptops over wi-fi to work on the database.
So i download mysql installe, run it, and i connect via localhost perfectly well with the root acc or the set up accounts i will use. I do bind-address to change its ip to the computers IP on the network, and i can connect again with root and with my accounts perfectly well on the machine the same server is on, using xx.xx.xx.xx + port to connect, with root and all other users.
however, using workbench on a laptop connected to the local network, I cannot connect with any user, it always gives error 10060.
--Firewall is off
--All AV software is off
--accounts are set up correctly to allow connection from any host
--client PC can ping server PC
--Netstat -anob shows mysqld.exe listening on the port i need it to be listening
The network here does block connections, but the port im using is open due to the fact it is used for another server type application that as very little to no traffic, so i just grabbed the opened ports for that application as they showed up in netstat and configured te server to use one of those ports.
How can i make sure the server PC is open at those ports?
THe client im trying to connect with is either the mysql workbench or heidisql.
Neither can connect, however i have succesfully used heidi before to connect to a database I have in DB4free.net. I cannot use that at the hospital, because the network shuts off the default port for mysql which is what db4free.net uses.
Any ideas why i cant connect to that PC?
mySQL often does not come configured for remote connections by default. The port may be open, but if mySQL isn't listening or is set to reject all remote connections, you won't be able to connect.
Check the documentation for your version of mySQL to find out how to modify your mySQL server's configuration to allow remote connections.
I'm trying to connect MySQL Workbench to an Amazon EC2 (Linux) instance that hosts a MySQL Database. (Not RDS but localhost). However for some reason, I can't get it to connect remotely.
Things Ive done:
- Set the security group to allow any IP to access port 3306
- Created a mysql user and granted all privledges on it.
- Modified the my.cnf to include bind-address=0.0.0.0 However i still cant connect.
On this instance I do have SSL cert installed and I am forwarded all http request to https?.. But im not sure if this has anything to do with it.
If anyone could guide my in the righ direction I would appreciate it.
I would personally give it an Elastic IP so it will have a public IP, then bind the mysql to that IP. Make sure the iptables are set to accept the mysql connections. I also wouldnt suggest leaving mysql open to every ip unless this is an absolute necessity.
I'm trying to access a database from the default Linux MySQL client, but all I get is a timeout. It's actually the database used by a WordPress website, and in the configuration file I can see that the IP address of the DB server is actually localhost (127.0.0.1). So I assume that the host name of the DB server is the same as the website's.
I am able to connect to the database with a PHP script that I wrote and uploaded to the server with this same information, and with the show variables query I was able to verify the port number (which was 3306) and specify it to the client. I can see a lot of variables but I'm not sure which one to use.
Any help?
If your Wordpress site is remote, you must connect to DB server like remote connection not local connection. If wordpress and DB server are in the same server, the configuration file to connect with DB is localhost, but if you want connect from remote host you must config your connecto with remote data.
Under what scenarios would one want to connect to a host other than localhost? What I mean is when:
mysql_connect('localhost', 'root', 'root');
I provide 'localhost' as the first argument without ever stopping to think what purpose it serves. I guess the opposite would be remote host, but when would you actually use it?
localhost is a hostname that refers to the local machine.
Therefore, you pass that to connect to a server running on the local machine.
If you want to connect to a MySQL server running on a different machine, you would pass that machine's domain name or IP address instead of localhost
.
It depends where the SQL server is living. In an application architecture you could potentially have UI, Services, and SQL living on separate boxes. In this scenario you'd point mysql_connect() to the appropriate machine.
localhost is simply an alias for the computer that you are running the script on. By connecting to localhost, you are connecting to a server on the same computer.
Replacing 'localhost' with an IP or host name allows you to connect to a different computer.