MySQL:Error 2003 lost connection from a virtual machine on the same localnetwork - mysql

Apologies for the bad english, i'm french. :D
I've been looking for an answer since approximatively 4 days, and I don't know how to fix my issue.
So:
I want to virtualize two servers using virtualBox on Windows7 and i want them all on the same local network.
My VMs are running on Ubuntu 16.04
On the first VM I installed a lamp web server with MySQL 5.7 and i add phpmyadmin.
On the second VM I installed Jira standalone
--> I need to connect to my Database from my Jira server
So I used the Bridge adapter on each machine:
network configuration
network configuration
Ip adresses are attributed with the DHCP protocol.
The SQL machine ip is 192.168.6.80
The Jira machine ip is 192.168.6.101
The Host machine ip is 192.168.6.87
I'm able to ping each machine so there is no problem.
SQL server
When I start the machine everything seems to work, i can access from my SQL server:
localhost : home page of apache 2 saying "It Works"
localhost:5671 :
[���
5.7.18-0ubuntu0.16.04.1� ���UKBeM�ÿ÷�ÿ����������T(DGKg1hwd=�mysql_native_password���ÿ„Got
packets out of order
localhost/phpmyadmin : the index page where I can connect perfectly with root.
Host Machine (Windows)
192.168.6.80 : home page of apache 2 saying "It Works"
192.168.6.80:5671 :
[���
5.7.18-0ubuntu0.16.04.1� ���UKBeM�ÿ÷�ÿ����������T(DGKg1hwd=�mysql_native_password���ÿ„Got
packets out of order
192.168.6.80/phpmyadmin : the index page where I can connect perfectly with root.
Jira server
Here when i start the machine it works during approximatively 2-3 minutes,
I'am able to connect via:
mysql -u root -p -h 192.168.6.80 -P 5671
I am perfectly connected and i can also access to all the other adresses.
And then it stop working on this machine only.
Unable to connect
Firefox can’t establish a connection to the server at 192.168.6.80.
The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer’s network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
And when i re-try to connect via mysql on terminal I get the Error 2003 (HYOOO)
This happen only when i use the connection of my work, at home it works perfectly without stopping!!
I have few leads:
problems of proxy authentication
problems of firewall configuration
i am in a private network with a domain name called something.eu
And when i launch firefox the proxy shows up automatically:
and-etc-ha.something.eu:9090
So i'm invited to enter my id and password.
My id is : luc.myName#something.eu
After that i'm connected to internet with firefox but not in terminal when i want to use apt.
I search on the web and i found this:
export http_proxy="http://Username:password#proxyip:port/"
and
export http_proxy="http://Domain\user:pasword#proxyip:port/"
So I tried different ways and i was able to download with apt. But the internet connexion with firefox was unstable. But if I use firefox on my host machine the connexion is perfect.
I also tried with settings -> network -> network proxy -> method manual
http: and-etc-ha.something.eu port: 9090
I don't know if I was understandable, tell me!^^
If you have any ideas to help me to solve this problem let me know.
Bye!

I found the cause: In fact there was a ip conflict inside the LAN because the DHCP was giving in-use ip address.
I decide to use the NAT connection with Port Forwarding on VirtualBox.
With that configuration I'm able to access my VMs on my LAN using the host ip address followed by the port of my choice.

Related

issues connecting to AWS production database

I've been working in a local and staging database (hosted on AWS) for this app I'm working on with no issues viewing and seeding data in both environments. However, when I try connecting to the production environment to either view or seed data, I get the following error:
mysqli_real_connect(): (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
I've double checked that the credentials I used matches the credentials of the production environment and I retyped out the credentials also to ensure no whitespace characters accidentally got copied over.
I thought maybe I was having an issue with the administrative tool so I switched from phpMyAdmin to DBeaver which also didn't seem to work.
Disabling my firewall also didn't help out.
After some research online I followed this guide to authorize RDP traffic to my computer's public IPv4 address, but after following these steps I still get the above error.
my phpMyAdmin config file looks like this
/*
* Production Server
*/
$i++;
$cfg['Servers'][$i]['host'] = 'host';
$cfg['Servers'][$i]['user'] = 'user';
$cfg['Servers'][$i]['password'] = 'password';
/*
* End of servers configuration
*/
?>
Using XAMPP v3.2.3 with server version MySQL 5.7.26-log and the platform runs on AWS is PHP 7.2 running on 64bit Amazon Linux/2.8.12
I'm using a Windows 10 machine and I wanted to note that my coworkers are on a Mac and had no issues connecting to the AWS instance in a remote location from me. Neither coworkers added their IPv4 to the security group.
Can anyone point me to the right direction of where the problem could be occurring? I'm stumped on this one...
RDP and RDS are completely different. RDP is remote desktop protocol and is therefore a method to log onto a Windows machine. RDS is AWSes managed Database service which allow you to connect to a database flavour (in this case I expect you've chosen MySQL).
If you want to connect from your local PC to RDS then ensure that you've enabled traffic from your public IP via tcp/3306 in the security group that RDS is using.
If you want to connect from RDS to your own local MySQL instance then you'll probably need to set up a NAT on your local router which maps from it's public ip and tcp/3306 to the appropriate private ip and tcp/3306 but if you do that it's really important to ensure you restrict incoming traffic from the appropriate source IP only.
By the way, is it possible that the person on a Mac is tunnelling through an SSH session to get to the database?

MySQL Remote Connection (Replication)

I have the following topology.
One Ubuntu 16.04. Instance on the Amazon AWS where my global MySQL Server is running. I want to use this Server as a Slave (Multi-Source Replication) for many local Master (Windows Machines MySQL Server).
For Testing Reasons I`ve Managed to make this running on one local Machine (with three different MySQL Server Running).
But now I want to make this Replication work on the mentioned global Server with the local ones. But it fails on the attempt to connect from the EC2 ubuntu Instance to the local Windows MySQL Server.
When I try to connect from my EC2 Instance to the local Computer with MySQL running on Port 3307 it keep saying:
ERROR 2003 (HY000): Can't connect to MySQL server on (113)
The strange Part is, that I can PING the Local Computer but not telnet it.
Telnet just says:
telnet: Unable to connect to remote host: No route to host
I can access the Global (EC2 / Ubuntu MySQL Server) from the local Machine but not the other way around.
I`ve already made a new Rule for this Port on the Windows Firewall Settings.
But the Port 3307 on the IPv4 Address seems to be still Closed.
I have no clue what I am missing to get a Connection from the EC2 Instance to my local Computer via TCP.
Do I have to open the Port Specific on the Router?
I hope for your help.
Best Regards.
It seems like your local computer is not visible, as your incoming ports to your local pc are closed. It may be a problem with your router, or your internet service provider, which is not allowing you to open ports(the most common one).
The possible solutions are:
1.) If your ports are not open due to the router
Try forwarding required ports to your pc.
Try Switching off your NAT firewall that may be blocking ports.
Try switching off your windows or antivirus firewall if any.
2.) If your ports are blocked by your Internet service provider.
Try getting help from ISP
Switch to a static IP connection if on dynamic.
Use a VPN service that provides an unblocked port service to all IPs.(This one solved my problem when I was struck in this situation.)

Cannot connect to mySql from a lan network computer

I have a MySql Server 5.7 running as service on one computer of a LAN.
My application is installed and running fine on the same computer. I have 'Shared with everyone' set for the directory where my application is located. In the same directory I have put the libmysql.dll and the FDConnectionDefs.ini files.
My application is running fine on that computer. On the other computers on the LAN I created a link to the directory where my application is shared. When I try to run my application from these LAN systems they produce the error message
[FireDac][Phys][mySql] can't connect to mySql server 127.0.0.1 on port 3306... (10061).
All machines are running Windows 10 on 64 bit processors.
Here what i've tried to resolve the problem:
make sure that the user, password and host (%) are the same in mySql Profile and FDConnectionDefs.ini.
I've tried with different users even with root, i've tried to change host (%) to put the IP address of the computer trying to connect in the mySql profile.
I make sure that i have permissions to run my application and mySql and that the port 3306 is open in the Firewall/Kaspersky on each computer of the LAN. But always the same error message.
127.0.0.1 is a special IP address - the "loopback" address that is typically resolved for localhost on most systems. It is a private internal IP address that a computer can use to refer to itself. It has no meaning to other systems on a LAN since every computer will recognize 127.0.0.1 as meaning itself.
This means that when you are running the application on a remote system it will be trying to connect to a MySQL server running locally rather than on a server elsewhere.
You'll need to configure your FireDac components to connect to the actual LAN IP address that belongs to the system hosting the MySQL server. You will probably also need to make sure that your MySQL users are set up to authenticate from an IP other than localhost.

Mysql Connecting remotely

I'm having a problem running a MySQL server that is hosted on another server that isn't the web hosting server. Currently my web server is running on godaddy's free linux hosting. They do offer a MySQL database free, but you can't connect remotely (Sequel Pro OSX program) without paying for an upgraded hosting plan. So temporally, I'm going to host the database on my server at home (XAMPP). Well, whenever I try to connect to the database using the PHP command mysql_connect() I'm getting an error:
"Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 110"
before it was saying 113 (I believe).
Any-who, I tied to use the 'Bind-address' and changed it from 12.0.0.1 to my LAN IP. it didn't work or I didn't do it right. So, any help I can get on this would be awesome.
FYI, I can connect to the database remotely from inside my network using Sequel Pro. But the godaddy server can't connect. Port is open also, so that's not the problem.
Out of the mouth of a godaddy support guy, "Our shared hosting plans do not give you the ability to connect to an external database. If you wish to have this ability, you would need to look into one of our server hosting options."
So, my configuration is correct, it's just godaddy has it blocked. Lame! Thanks everyone for the help.
If you're hosting your database to a home local machine, you should also redirect router "xxx" TCP port to 3306 TCP port of hosting pc.
Remember you must connect to WAN ip on port "xxx".
You can use free dns services like dyndns to map your internet connection to a name (example yourname.dyndns.org)
Redirect a port (default 3306) of your router to 3306 TC port of your hosting pc (internal)
From remote pc connect to yourname.dydns.org:3306 or to port you redirected on router

Cannot connect to remote mysql from Mac lion

I'm a mac novice and trying to get a developer setup to develop php sites locally. The sites he develops have a mysql backend and that is on a remote box. We got xampp installed and working, he can connect from the website to the local mysql box but he cannot connect to the remote box. He is using the exact same connection info I am using from my windows system. I do not have any issues. Also the mysql server is setup to accept all users (we are currently using root) regardless of hostname.
I searched his system and I could not find a mysql.sock file. I do not know what this does, but googled some articles that mentioned.
Please help if you can.
Try Telnetting to the server from your host and see if you get a response.
telnet host 3306
If that doesn't work, you probably have some local firewall on your mac that is blocking the connection. Also, one thing you don't mention is that you can connect from a windows computer and not a mac... are they on the same network? If they're on different networks or in different places, that could indicate a local network issue.
This is definitely not an issue with mysql, but with something on the Mac itself.
The mysql.sock file is relevant only to the machine the MySQL server is running on, for local clients to communicate with the server. For any remote machines, they'll be connecting via TCP on port 3306.
Make sure that port 3306 is open in the server machine's firewall, and that MySQL has been configured to allow TCP connections.