Namecheap coulnt connect on shared hosting trough SSH tunnel

payter's profile image payter posted 4 months ago in General Permalink

Hi, i have an issue connecting to Namecheap shared hosing for 2 days. When I set everything correctly both tunnel credentials and MySQL credentials, but I always get

Connection failed
Access denied for user 'myusername'@'localhost' (using password: YES)

When I try to do the same on, for example, Navicat, to use the same credentials then it connects successfully

What could be the issue? Because it looks like the issue is with HeidSQL, I tried to solve it with Namecheap support but they are clueless and couldn't figure any issue on their side.

Some things to mention:

  • for the SSH tunnel I'm using plink.exe
  • as Hostname on MySQL I set 127.0.0.1 instead of localhost, that didn't helped
  • library is set libmariadb.dll
  • using the most recent build 12.8.0.6908

thx for any help, your software is best for MySQL

payter's profile image payter posted 4 months ago Permalink
  • and i tried to change MySQL password to password without any special characters, that didn't helped
ansgar's profile image ansgar posted 4 months ago Permalink

I would first check if the basics are set correctly:

  • localhost or 127.0.0.1 in the "Settings" tab, field "Hostname"
  • on the "SSH tunnel" tab:
    • SSH activated?
    • remote host/ip in the "SSH host" field?
    • SSH timeout not too low? I recommend 3 or 4 seconds, probably more on slow connections

If all is correctly set up, then activate Tools > Preferences > Logging > "Debug logging". Then, open any other connection which is working, so you see the main window and the bottom log panel. Now try to open the non-working session and watch the log panel what is dumped there during initialization. Maybe that gives you the critical hint.

payter's profile image payter posted 4 months ago Permalink

yes, everyhing is correct, now im copying logs, my credentials are substituted for security reasons:

/* Connecting to 127.0.0.1 via MariaDB or MySQL (SSH tunnel), username {{username}, using password: Yes ... */
/* Attempt to create SSH process, waiting 4s for response ... */
/* plink.exe -ssh {{username}}@{{username}} -pw "******" -P 21098 -N -L 0:127.0.0.1:3306 */
/* SSH: Using username "{{username}}".
 */
/* Access denied for user '{{username}}'@'localhost' (using password: YES) */
/* Closing SSH process #49436 ... */
ansgar's profile image ansgar posted 4 months ago Permalink

Ok, can you connect on the command line with a plink command "by hand"?

payter's profile image payter posted 4 months ago Permalink

Yes, connection directly by plink.exe works fine

ansgar's profile image ansgar posted 4 months ago Permalink

And when you leave the manual SSH connection open, and connect to localhost in TCP/IP mode in HeidiSQL? Should be basically the same as when you define the tunnel in HeidiSQL.

ansgar's profile image ansgar posted 4 months ago Permalink

Oh, and you should check the user grants on the server. It may be the case that "youruser@localhost" is not granted anything, but "youruser@127.0.0.1" has privileges.

payter's profile image payter posted 4 months ago Permalink

I managed it to work by accident, on their page

https://www.namecheap.com/support/knowledgebase/article.aspx/1249/89/how-to-remotely-connect-to-a-mysql-database-located-on-our-shared-server/

I was not using Local port on SSH tunnel, I tried multiple time to use 3306 or 5522 like they said about local ports on that documentation, but then not even SSH tunnel worked. Now I wanted to try it again but I misspelled 5522 and set 552 instead... and it worked! I have no idea why, and when I try any other Local ports, it also works.

So I have no idea why set random Local port fixed MySQL login issue, but its fixed not, thx for help.

rimsha99's profile image rimsha99 posted 3 months ago Permalink

f Navicat connects but Heidisql doesn't, the issue might be with Heidisql's configuration. Try these steps:

SSH Tunnel: Ensure plink.exe is correctly configured and active before connecting. MySQL Host: Stick with 127.0.0.1 for the host. Permissions: Verify that your MySQL user has the right permissions. Library: Switch from libmariadb.dll to libmysql.dll in Heidisql. Run as Admin: Run Heidisql as an administrator. Compatibility: Check Heidisql's compatibility with your MySQL version. Enable logging for more detailed error messages. Hope this helps!

Please login to leave a reply, or register at first.