Error during Flutter connection to localhost DB - mysql

Am trying to connect to connect flutter to local xampp, it executes with the above error, any help is appreciated
SocketException: OS Error: Connection timed out, errno = 110, address = 192.168.1.254, port = 38614

1- if you are using emulator use 10.0.2.2 instead of 192.168.1.254
2- if you are using physical device make sure the device is connected to server first without the flutter app by accessing the ip of the server from your device or 10.0.2.2 if emulator
3- try disabling your firewall and antivirus

Most likely your emulator doesn't have access to IP 192.168.1.254 on your host machine.
You can test this by opening up Chrome in your emulator and trying to visit: http://192.168.1.254
The Android emulator provides access to your host machine through IP 10.0.2.2. So if you have a website running at localhost (127.0.0.1) on your host machine, you should be able to access that from Android emulator Chrome browser using http://10.0.2.2
Android emulator also delegates DNS queries via 10.0.2.2. So if your host machine hosts file (C:\Windows\System32\drivers\etc\hosts or /etc/hosts on Mac) has domains specified (such as 192.168.1.254 myxampp) then you can edit your emulator's hosts file to delegate the domain lookup to your host machine hosts file using:
10.0.2.2 myxampp
Here are some instructions on how to edit your emulator's hosts file if you decide to go that route.

Related

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

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.

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.

Can't access MySQL via 3G connection

I have one strange situation that I need help with...
My Linux machine is connected to internet via 3G connection and it is set up to save collected data to MySQL database that is located on a shared hosting. It's been working like that for a couple of months now without problems and now I'm trying to switch from shared hosting to a new VPS server that I've rented two weeks ago.
On new server I have MySQL installed and working, tried the connection from my desktop machine via Workbench, as well as from my mobile phone.
When I try the connection on Linux machine - it just won't connect to MySQL (double checked all the parameters).
I am connecting via IP address on standard TCP 3306 port, I'm sure that port is open on Linux machine because it worked with shared hosting without problems, and on VPS I know is opened because I can connect from my home machine and mobile phone (both on separate networks).
It seems to me that IP address of VPS server can't be accessed from Linux for some reason, but I can't tell why.
Telnet to VPS IP via 3306 port works from my (windows) desktop machine, on Linux I've tried
nmap {IP address} -p 3306 -PN
and got response:
PORT STATE SERVICE
3306/tcp filtered mysql
Everything seems to be working from other networks except the one on Linux station, and I don't know where to look for the problem. I have also a windows laptop that is connected to the Linux station 3G network and it also does not recognize the VPS IP address (can't telnet to 3306 port), but when I connect laptop to tethered network from my mobile phone - telnet to 3306 works... I'm totally puzzled!
Does anyone have an idea what I might be doing wrong? Why the VPS can't be accessed via 3G network?
Any help would be appreciated!
Thanks!

StreamSocketListener and localhost

I'm using the following code to set up a StreamSocketListener on my universal 8.1 app:
_listener = new StreamSocketListener();
_listener.Control.QualityOfService = SocketQualityOfService.Normal;
_listener.ConnectionReceived += OnConnectionReceived;
await _listener.BindServiceNameAsync("8776");
This runs without any problems, however when I try & browse to http://localhost:8776 (or directly via ip address or machine name), the request times out.
In netstat I can see the 8776 port is open & listening, I've enabled loopback exemption, disabled my firewall, but I'm still not able to connect. This is true for both the Windows 8.1 and the Windows Phone 8.1 app.
When I try to connect from another machine, it works without problems. Is there any setting/configuration I can use so I'm able to connect from the same machine?
Windows RT blocks loopback access between two WinRT applications.
Network communications using an IP loopback address cannot be used for
interprocess communication (between two different apps) in a Windows
Runtime app since this is restricted by network isolation. Network
communication using an IP loopback address is allowed within an app
within the same process for communication purposes.
More info and workaround here

AIR for Android SocketServer over WiFi

Developing a multiplayer game for Android and using the AIR SocketServer class to communicate between server and client AIR applications.
On Windows 8 I am using Virtual Router Plus to set up my PC laptop(where the server app is running) as a wifi hotspot.
I run ipconfig in cmd after my wifi is running to grab the ipv4 IP address under 'Wireless LAN adapter Local Area Connection'
This is the IP I bind to in the server app and connect to in the client app.
If I launch both server and client on the same machine, everything works fine.
When I install the client app on my Android device, I am unable to establish a socket connection. The WiFi is running properly on my Android device.
Is a policy file necessary on the server machine when creating socketserver connections over a local wifi network?
If so, shouldn't the client app be throwing a security error when it tries to connect?
I am lost as to what my troubleshooting steps should be. ANY tips or feedback appreciated!
This happend because, the AIR Socket communication works only in Desktop application.
Try this native extension, it works perfectly form me:
http://blog.aboutme.be/2011/12/14/udp-native-extension-for-air-mobile-now-with-android-support/