Can't connect to MySQL server on AWS. AWS says access denied to client and replaces the AWS hostname with local IPv4 address - mysql

I am unable to access an AWS server on various software -- Microsoft Remote Desktop, MySQLWorkbench and DBeaver. The credentials are correct and the same as those of my teammates and they are able to access the server. It resolves the hostname to be the IP address and not the host address, which is strange. In the dialog box attached, it should say that Access is denied to admin# but it says admin instead.
I have tried uninstalling and installing MySQLWorkbench multiple times. I uninstalled and installed the mysql library. I have tried changing the my.cnf files but that doesn't help either. I have a suspicion that it may be something on the server-side (AWS). I looked at the AWS console and it allows access to all IP addresses. I have tried a lot of things and still face the issue of the hostname being resolved to the local IP.
Can you please help me out?
enter image description here

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: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.

Connecting to a remote apache server

I need to connect to the server "http://ec2-52-57-235-167.eu-central-1.compute.amazonaws.com/" . I have the server's username and password access. I tried accessing from Filezilla but it says the "Invalid protocols specified."
What is the recommended way to access this server remotely from the internet so that I can access its files and edit its contents.
The server is hosted online now I want to access it from my local machine.
P.S. I also tried to find out the I.P address of this url but can't seem to figure out by the command "Tracert" in the command line.
Thanks.
Install putty and access the server with SSH connection. Filezilla won't work due to precedence of protocols.

ERROR 2003 (HY000): Can't connect to MySQL server on 'xxx.xxx.xx.xx' (10060)

I'm trying to connect my local MySQL to a test 2nd generation MySQL instance on Google SQL platform using the following command on my windows laptop.
mysql --host=130.211.xx.xx --port=3306 --user=root --password
I double checked my IP address with whatismyIPaddress.
I can connect via Google Cloud Shell on the Google Platform itself and also ping the IP address from the local cmd prompt.
As a troubleshooting step I have disabled the local firewalls on my laptop and granted full access to 0.0.0.0/0 to allow all connections on the google platform console.
still no joy from either a cmd line connection on windows or using a putty client, can anyone give me any further pointers on the missing step?
Cheers..
If you are behind a NAT your IP might change which prevents you from accessing the Cloud SQL instance. I would recommend setting up access using SSL certificate. More information about the setup can be found in this Help Center article.
You may need to allow remote connections to your remote database in the server and database configuration. These kinds of connections are typically disabled by default.

Login to EC2 server to create MySQL database

I had a friend create an AWS account and an EC2 instance after which he gave me the username and password to login. I am having a lot of trouble getting into the server with the information he gave me. I'm new to amazon services so I'm not sure if I'm doing something wrong or not. I seem to be able to login using PuTTy, but it doesn't prompt me for a password, I just get through with the username alone. copying the ip into a browser just gets me a "This webpage is not available"
message. He also gave me the key file but I'm sure where to use it.
Anyone know how I can get into the server to modify the database?
If there is a message 'This webpage is not available' then it could be there is no HTTP server running on port 80, or the security group configured on the EC2 instance is set to deny connections to port 80. If it is a new instance, there probably isn't a firewall configured locally to deny connections.
If you are sure there is a server running on port 80, you can use these instructions to tunnel through SSH
Set up your PuTTY window like this, and hit the Add button
Navigate to http://127.0.0.1 and you should see the web server if there is one running, if you can navigate using this way, you have a problem with your security group configuration. If you cannot, you do not have a HTTP server running to connect to. If there is not one running (and I am assuming you wish to use phpMyAdmin), you may have to set up apache and install phpMyAdmin
As you connect without a password, do you receive a line along the lines of
'Authenticating with public key "unipc-rpi"' or mentioning 'Pageant', because it means that instead of a password, PuTTY is authenticating using a public key and not a password.