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
Related
I deploy a mysql service on my company remote develop CentOS machine, I'm sure the service is turn on, and it can be access from an other reomte linux machine.
However, I can't connect it from my own Windows PC. I tried mysql workbench client and HeidiSQL client, both failed. I can ping through the remote IP address. I have tried anything I can found on google. Like
add bind-address = 127.0.0.1 to cnf file, and comment out the skip-networking.
I also tried the answer on another question Can't connect to remote server using MySQL Workbench on mac, which allow all machine can access to the service.
But my PC still can't connect to it, which report code 10060 error. So what should I do?
That bind-address = 127.0.0.1 config option means that your mysql server only accepts connections from the localhost, which is your actual CentOS machine. Make sure to set bind-address = 0.0.0.0.
Also, make sure that:
you have connectivity from your windows machine to the CentOS one
no firewall blocks the external connections to the local mysql port
Regarding potential security concerns from opening your mysql instance to the whole internet - first make it work, then make it better
I had the same issue here man,and i discovered that we need to create a user that isnt the root user. I my case, i don't know why yet, the issue was that.
The solution
Steps:
1 - Check the firewall (create a rule for port 3306 or disable it).
2 - Comment the line # bind-address=0.0.0.0 at [mysqld] config optin in C:\ProgramData\MySQL\MySQL Server 5.7\my.ini
3 - Create the user to remote access:
mysql> CREATE USER 'net'#'%' IDENTIFIED BY '123';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'net'#'%' WITH GRANT OPTION;
In my case, solved.
I have been trying to find a solution but could not fixed my problem. MySQL database is hosted on a remote server inside Virtual Machine, I have only rights to the Virtal Machne, I have tried following solutions but still my problem is not fixed: Added 3306 port for MYSQL in firewall settings, disabled the firewall, remove bind-address from my.ini files on my local machine as well as server and grant the priviliges from mysql client tool but no success. Can anyone help me out with this problem please?
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 server and workbench on a machine that is running on Ubuntu Linux platform.I also have installed mysql server and workbench on my machine that is running with Windows 7 OS.Both the machine are connected to network.I want connect to the mysql server from my machine.i tried changing the bind address of mysql server according to the machine's ip, and gave that ip as host name while connecting through mysql workbench from my machine.But i am not able to connect successfully.Please Help
Well, IMHO, the only problems that could be are ither:
Username does not have enough priveleges
Server does not accept connections
Firewall Blocking port
You should investigate each of these cases
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.