I have:
- A local
Windows 10
PC running MySQL Server 8.0.33 on port33060
. - A remote
Ubuntu 20.04.6 LTS
VPS running MySQL Server 8.0.33 on port3306
.
I want to create a reverse tunnel using PuTTY on my Windows PC so that my Ubuntu VPS is able to connect to my local MySQL instance running on port 33060.
For example, I'd like to connect via this command:
username@localhost:~$ mysql -h localhost -P 33060 -u test -ptest
Note: I've already created a MySQL test user on my Windows PC with the following settings:
Name | Value |
---|---|
Login Name | test |
Authentication Type | caching_sha2_password |
Limit to Hosts Matching | % |
Password | test |
Account Limits | Unlimited - 0/0/0/0 |
Administrative Roles | Full Privileges - Everything is Checked |
However this happens when trying to connect:
username@localhost:~$ mysql -h localhost -P 33060 -u test -ptest
ERROR 1045 (28000): Access denied for user 'test'@'localhost' (using password: YES)
username@localhost:~$ mysql -h 127.0.0.1 -P 33060 -u test -ptest
ERROR 2007 (HY000): Protocol mismatch; server version = 11, client version = 10
Note: If it makes any difference, AllowTcpForwarding
is enabled in /etc/ssh/sshd_config
on my Ubuntu VPS and the OpenSSH service was restarted via service ssh restart
.
Here's my PuTTY configuration:
I've tried all kinds of combinations of settings but my Ubuntu VPS can't connect to my Windows MySQL server.
For what it's worth, I was able to have my Ubuntu VPS successfully connect to PHP's built-in webserver running on my Windows PC with basically the same PuTTY settings (just different ports):
PS C:\test> php -S localhost:9876
[Tue May 23 23:10:50 2023] PHP 8.0.8 Development Server (http://localhost:9876) started
[Tue May 23 23:11:01 2023] [::1]:64617 Accepted
[Tue May 23 23:11:01 2023] [::1]:64617 [200]: GET /
[Tue May 23 23:11:01 2023] [::1]:64617 Closing
username@localhost:~$ curl localhost:9876
Hello World
But getting back to MySQL, is this a configuration issue with PuTTY, MySQL Server on Windows, or something else entirely?