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

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.

Related

unable to connect to mysql on GCP compute engine

I have installed mysql on a VM in gcp using this: https://cloud.google.com/architecture/setup-mysql
(I manually installed it on a VM)
But I am not able to connect to it using DBeaver. I am using the external IP provided in the dashboard and I have allowed 3306 but even then I am not able to connect to it. I keep getting connection refused: 4003 error
connection refused: 4003 error
This means the instance isn't listening on the port you're trying to connect to or the firewall is closed. In order to fix this error, we need to ensure that the listening process on the VM runs and listens on the correct port. Then, we verify if the Google Cloud firewall is configured correctly and open
You should look for default-allow-ssh to see if your firewall's rules allow SSH connections. If the firewall and IAP do not resolve your issue.
Check whether you have access. When you add a user and grant privileges to them (or with existing users) you need to specify the host or network range from which that user is allowed to connect. Follow the steps in this stack question and check whether you can connect now.
for more information follow How To Allow Remote Connections To MySQL. Attaching SSH troubleshooting doc.

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

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

How to connect to Azure Ubuntu VM MySQL server from local machine MySQL workbench?

I did set INBOUND PORT RULES in Azure. but still it is not working.
I want to connect this with MySQL workbench and with google VMs it works. If you can please help with this?
Some possible reasons you might consider in this case:
If you can connect to google VM with MySQL Workbench, I suppose the local firewall is open for the destination SQL server ports.
Check the NSG both VM and subnet level.
Check if the SQL server configuration is well, especially the SQL server port, options for connectivity. You can get more references about Connect to a SQL Server Virtual Machine on Azure.
Check if the port 3306 is listening on the Azure VM by using netstat -anpl | grep 3306. If not, you can check if your VM firewall blocks this access.
If the issue still exists, you can add more details about your question.
You need to create a Firewall Rule to allow inbound traffic from the Public IP address where MySQL Workbench is being launched (See Image).

Google Compute Engine LAMP Stack SFTP,SQL and HTTPS

I've setup a google compute VM, and can access phpmyadmin and the default index page. SSH works when I click the button on the website.
I am having issues remotly connecting to my server instance for any sort of management(ftp or sql)
I followed the firewall section here: https://cloud.google.com/solutions/mysql-remote-access
But I still can't connect.
My firewall is configured:
And I have no idea how to get HTTPS working, But it can be a problem to take care of in the future when I fully switch my site over the compute engine. Since I can't switch my domain or current SSL certificates over yet.
EDIT:
More information:
When I try to connect to SQL using client "Sequel Pro" it returns:
With telnet:
When I try connect to SFTP I get:
Could this be caused by me mistyping the password?
Your firewall settings show that you allowed external traffic to both ports 21 and 3306 for TCP protocol. This is good but not enough.
In order to allow remote connections to MySQL, you will need to grant remote access to your username and your external IP address. Take a look at this case for an example. This is also mentioned in step 6 and step 7 of Configure MySQL server on my-server section of the article you specified:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'TESTUSER'#'<external-ip-my-client>' IDENTIFIED BY '<some-password>';
About the ftp server, the VM instance comes with no ftp service installed, but instead you can use SFTP protocol to connect to it which is more secure than FTP protocol and is highly recommended. Use gcloud compute config-ssh to generate SFTP/SSH key pair. For more information visit Setting up secure FTP on Google Compute Engine artcile.

Connect SSH MySQL server from Windows

I have installed MySQL on Ubuntu using SSH and would like to connect phpMyAdmin installed on a Windows machine.
I tried to add a server like standard server, but I can not log in to MySQL server using SSH.
Does phpMyAdmin support to connect a remote server using SSH? If yes, how can I configure a private key for phpMyAdmin or do I need a SSH client for this?
I think there's a bit of misunderstanding that might be hindering you sorting this out.
SSH is the Secure Shell protocol, which allows a user to remotely access the command line of a server. You can access MySQL via SSH by using SSH to start a command line session on the server and using the mysql command line client as if you were at the machine directly.
phpMyAdmin can connect to a local MySQL instance (where MySQL and your webserver run on the same machine) or connect to another machine through the network (where MySQL is running on one machine and your webserver is running on another -- the connection in this case is via the the port used by MySQL itself, 3306). In either case, you can access phpMyAdmin itself from any browser on the network; it just appears as any web page. The communication between MySQL and phpMyAdmin can be encrypted (via SSL) if you wish, but still happens via MySQL communication and not over SSH. At no point is SSH used for the communication from the web server to the MySQL server.
So in your case, since you wish to install phpMyAdmin on the Windows box, you'd simply edit your config.inc.php to connect to the IP address or hostname of the Ubuntu server with the $cfg['Servers'][$i]['host'] = 'hostname'; directive, using the actual hostname instead. You'd then access phpMyAdmin from anywhere on the network by using the hostname or IP address of the Windows machine.
If, instead, you wish to install phpMyAdmin on to the Ubuntu machine, you could use the host name 'localhost' in config.inc.php and then access phpMyAdmin from the Windows machine (or any other machine) using the Ubuntu IP address/host name in your web browser.
It all depends which machine you wish to be the web server. phpMyAdmin runs under IIS or Apache runs under Windows, but Ubuntu makes installing all the programs easy through the package manager, so that's what I generally do in this situation.
Hope that helps clear it up a bit.