Unable to Connect to Azure MySQL from Ubuntu 20.04

azureMySQL

mysql -h foobar.mysql.database.azure.com -u me@foobar -p

From 18.04 and Windows 11, connection is successful. From 20.04, connection seems to hang, or never complete. I enter the password and get a prompt in 18.04, but not in 20.04.

18.04 client is 5.7. 20.04 is 8.0. Windows is 8.0.

I've tried several VMs in various locations and have been unable to get mysql client on 20.04 to connect. I've tried:

  • the 3 ports available – 3306, 3308, 3309, in various combinations with other options
  • allowing all traffic on the the Azure MySQL Firewall
  • disabling require SSL on Azure MySQL and using the --ssl-mode=DISABLED option
  • setting Azure MySQL to TLS 1.1 or 2.1 and using the --tls-version=TLSv1.1 or TLSv1.2 option. 1.1 fails with message SSL connection error: error:141E70BF:SSL routines:tls_construct_client_hello:no protocols available

None of these things have worked.

Best Answer

We had the same problem after unattended-upgrades updated the mysql packages to the latest version. Downgrading to the previous version (8.0.26-0ubuntu0.20.04.2) fixed the problem.

Related Topic