When i try to connect to my MYSQL-DB from a Windows-PC everything works, but when i try it from a Mac (I tried it with 2 macs) i get the errormessage "Can't get hostname". I'm using MySQL-Workbench 5.2.31. The DB is running on Windows Server 2008 R2.
EDIT: More Info:
The MYSQL Server is running on a Windows Server 2008 R2 machine.
The Server works, because i can connect from a Windows-PC. (The Windows-PC is not the Server)
The Port for the MYSQL Server (3306) is definitely open!
The Hostname is the DNS-address of the server!
Thanks in advance!
You need to add the ip-adress and a hostname in the hosts-file of the server. The server tries to get a hostname for the ip of the mac, but can't find any.
You may turn off this check in the config of your mySQL Server.
Check your dns settings. On mac, open a terminal check if nslookup win2008_dns_address resolves to your ip address. If not, fix your dns settings. Otherwise, again on mac, sudo vi /etc/hosts and append your Win2008 server ip and win2008 hostname there. Correct format would be
IP_ADDRESS HOSTNAME
save and try.
Related
I have an issue with my dockerized MariaDB. It happens when I try to connect to MariaDB.
Example with PhpMyAdmin: If I put MariaDB docker server's IP & port in the PHPMyAdmin config file (see picture), PhpMyAdmin can connect without any issue. But if I put the server hostname and the port, it doesn't connect. MariaDB doesn't accept the hostname. One of the problems I have is that the server change the IP, so it's an issue if I am not using the hostname. I checked that etc/mysql/my.cnf has #Bind 127.0.0.0 in docker container with #.
Also, the hostname works well in the browser (windows or linux).
Does anyone know how to fix this?
EDIT
I am also attaching the container info from Portainer.
Thanks
I tried everything which I found on google but couldn't connect linux mysql server from other server, Server where Mysql is located is Linux OS and from where I want to connect that is ubuntu, What can I do?
I already grant all privileges to user, bind-ip-address, and comment localhost etc. Is there any sqlserver's internal configurations?
Did you check ssh connectivity between two servers? if it doesn't works configure sshd properly and if ssh connectivity works fine then,The Target server's internal firewall might be blocking remote mysql connections.
After a long R&D, when nothing help me, I think about port number, and that was silly mistake, actually I check available port on AWS for that instance from I want to connect and found I forgot to open 3306 (default MySQL port). I just add this and everything became perfect.
I installed wampserver on my xp machine month ago.. Now when I try to connect to mysql via phpmyadmin or mysql console I get the error :
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost'
(10061)
Wamp icon in the tray is green meaning it's running ok.. I checked for mysql service and it's running and using the port 3306 .. I turned off the firewall.. I tried everything and it's not working.. I eventually uninstalled wamp totally and removed all its files and re-installed it again and same error.. When I try to telnet localhost 3306 it doesn't connect and I get the error :
Could not open connection to the host on port 3306: connect failed
I searched the web for hours, but didn't find any working solution. It seems that many people are having the same problem and most of them didn't find the solution.
Ok .. searching the internet for more several hours I've found one little clue that actually fixed my problem.
When I type netstat -a I get a list of active ports including 3306 (the one mysql uses). The Foreign Address column for some ports is 0.0.0.0.0 but for 3306 is [::]:0. I'm not a network guy but it turned out that it means it's a IPv6 port and it should be IPv4.
Adding the following line in the file my.ini under [mysqld] and restarting the service solved the problem.
bind-address=127.0.0.1
Note
My wamp version is 2.4 and mysql version is 5.6.12 running under win XP.
my.ini file for me is located at c:\wamp\bin\mysql\mysql5.6.12.
Hope this helps who suffered my pain.
In my.ini there is - for example -the entry
# Secure File Priv.
secure-file-priv="C:/ProgramData/MySQL/MySQL Server 5.7/Uploads"
If this path is not (further) existing, mysql cannot be started.
You have then to put an existing path.
I also did some research on my side I reconfigure the sql parameters then in the type and networking section you have to uncheck the open windows button Firewall ports for network access then you have to press next until closing without anything modify other
I'm trying to setup a new connection in MySQL Workbench to MySQL server on my other network computer named say: SERVER
Hostname: SERVER
Port:3306
Username and password I leave blank.
I'm getting "unknown server host"
SERVER has dynamic IP.
How do I provide the correct Hostname?
I don't think that you can connect to a computer of your network with its name only in MySQL Workbench.
So, if you can't allocate a fixed IP with DHCP to your computer running MySQL maybe you could use port forwarding in your router config (localhost:port -> computer2_ip:mysql_port) so you will be able to connect to localhost:port in MySQL Workbench. You could also create a tunnel between the two computer but I think this is rather a question for ServerFault.
I have installed MySQL on a Windows Server 2012 R2 using Microsoft's Web Platform installer.
What I'm having a problem with is how to remotely connect to it? I'm able to launch the MySQL command prompt on the server and can see that it is running on port 3306, uses root as the username, the correct password and I can see the hostname (the name of the server).
I have enabled an inbound rule in Windows Firewall for port 3306 but is there anything else I need to do? I'm trying to connect using MySQL Workbench on my PC but not getting very far.
Thanks,
Steven.
Most likely you need to correct your my.ini and either comment the bind-address variable, which is set to 127.0.0.1 by default, or set it to your server's IP address value.
For locations, please refer to: MySQL my.ini location