Getting forwarding errors when trying to connect to PHPMyAdmin

Keywords: LAMP/MAMP/WAMP - AWS - Technical issue - Connectivity (SSH/FTP)

bndiagnostic ID: dbde5cdd-f6b9-b167-b2cb-b3b24adf7ce4

bndiagnostic output:

? Apache: Found possible issues
? Connectivity: Found possible issues
https://docs.bitnami.com/general/faq/administration/use-firewall/

bndiagnostic failure reason: The suggested guides are not related with my issue

Description:
I have been unable to connect on my new instance (Debian 10 (64-bit), 8.1.1-8, ami-0ce8b23a2024850ad, USWest2) to PHPMyAdmin. I followed the instructions for setting up a tunnel via port 8888, but the connection is repeatedly refused. I finally checked the PuTTY Event Log, and here’s what it showed (I’ve anonymized IPs and paths):

2022-01-16 15:54:37	Looking up host "###.###.###.###" for SSH connection
2022-01-16 15:54:37	Connecting to ###.###.###.### port 22
2022-01-16 15:54:37	We claim version: SSH-2.0-PuTTY_Release_0.76
2022-01-16 15:54:40	Connected to ###.###.###.###
2022-01-16 15:54:41	Remote version: SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
2022-01-16 15:54:41	Using SSH protocol version 2
2022-01-16 15:54:41	No GSSAPI security context available
2022-01-16 15:54:41	Doing ECDH key exchange with curve Curve25519 and hash SHA-256 (unaccelerated)
2022-01-16 15:54:41	Server also has ecdsa-sha2-nistp256/rsa-sha2-512/rsa-sha2-256/ssh-rsa host keys, but we don't know any of them
2022-01-16 15:54:41	Host key fingerprint is:
2022-01-16 15:54:41	ssh-ed25519 255 SHA256:1uBFNKkcvm55sqq4Vx8nsJz5JZurqdDKklJ+NQmMGsw
2022-01-16 15:54:41	Initialised AES-256 SDCTR (AES-NI accelerated) outbound encryption
2022-01-16 15:54:41	Initialised HMAC-SHA-256 (unaccelerated) outbound MAC algorithm
2022-01-16 15:54:41	Initialised AES-256 SDCTR (AES-NI accelerated) inbound encryption
2022-01-16 15:54:41	Initialised HMAC-SHA-256 (unaccelerated) inbound MAC algorithm
2022-01-16 15:54:41	Reading key file "path\to\mykey.ppk"
2022-01-16 15:54:41	Offered public key
2022-01-16 15:54:41	Offer of public key accepted
2022-01-16 15:54:41	Sent public key signature
2022-01-16 15:54:41	Access granted
2022-01-16 15:54:41	Local port 8888 forwarding to localhost:80
2022-01-16 15:54:41	Opening main session channel
2022-01-16 15:54:41	Remote debug message: /home/bitnami/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
2022-01-16 15:54:41	Remote debug message: /home/bitnami/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
2022-01-16 15:54:41	Opened main channel
2022-01-16 15:54:41	Allocated pty
2022-01-16 15:54:41	Started a shell/command
2022-01-16 15:54:49	Opening connection to localhost:80 for forwarding from 127.0.0.1:55009
2022-01-16 15:54:49	Opening connection to localhost:80 for forwarding from 127.0.0.1:55010
2022-01-16 15:54:54	Forwarded connection refused by remote: Connect failed [Connection refused]
2022-01-16 15:54:54	Forwarded connection refused by remote: Connect failed [Connection refused]
2022-01-16 15:54:54	Opening connection to localhost:80 for forwarding from 127.0.0.1:49692
2022-01-16 15:54:54	Forwarded connection refused by remote: Connect failed [Connection refused]
2022-01-16 15:54:55	Opening connection to localhost:80 for forwarding from 127.0.0.1:49698
2022-01-16 15:54:55	Opening connection to localhost:80 for forwarding from 127.0.0.1:49699
2022-01-16 15:54:55	Forwarded connection refused by remote: Connect failed [Connection refused]
2022-01-16 15:54:55	Forwarded connection refused by remote: Connect failed [Connection refused]
2022-01-16 15:54:55	Opening connection to localhost:80 for forwarding from 127.0.0.1:49700
2022-01-16 15:54:55	Forwarded connection refused by remote: Connect failed [Connection refused]
2022-01-16 15:54:56	Opening connection to localhost:80 for forwarding from 127.0.0.1:49705
2022-01-16 15:54:56	Opening connection to localhost:80 for forwarding from 127.0.0.1:49706
2022-01-16 15:54:56	Forwarded connection refused by remote: Connect failed [Connection refused]
2022-01-16 15:54:56	Forwarded connection refused by remote: Connect failed [Connection refused]
2022-01-16 15:54:56	Opening connection to localhost:80 for forwarding from 127.0.0.1:49707
2022-01-16 15:54:56	Forwarded connection refused by remote: Connect failed [Connection refused]
2022-01-16 15:54:58	Opening connection to localhost:80 for forwarding from 127.0.0.1:49710
2022-01-16 15:54:58	Opening connection to localhost:80 for forwarding from 127.0.0.1:49711
2022-01-16 15:54:58	Forwarded connection refused by remote: Connect failed [Connection refused]
2022-01-16 15:54:58	Forwarded connection refused by remote: Connect failed [Connection refused]
2022-01-16 15:54:58	Opening connection to localhost:80 for forwarding from 127.0.0.1:49712
2022-01-16 15:54:58	Forwarded connection refused by remote: Connect failed [Connection refused]
2022-01-16 15:55:03	Opening connection to localhost:80 for forwarding from 127.0.0.1:49720
2022-01-16 15:55:03	Opening connection to localhost:80 for forwarding from 127.0.0.1:49721
2022-01-16 15:55:03	Forwarded connection refused by remote: Connect failed [Connection refused]
2022-01-16 15:55:03	Forwarded connection refused by remote: Connect failed [Connection refused]
2022-01-16 15:55:03	Opening connection to localhost:80 for forwarding from 127.0.0.1:49722
2022-01-16 15:55:03	Forwarded connection refused by remote: Connect failed [Connection refused]

=======================
Notice the 5-digit ports it appears to be trying to forward, instead of the typical port 8888. I have no idea why this is happening, and I’m stalled on my ability to transfer websites.

I have already fixed the Apache error noted in the BN Diagnostic tool output, and the ports 80, 443, and 22 are already open. I noticed several people having access issues starting in May 2021, but none of those topics had resolutions reported.

Can you advise? This is total work stoppage for me. Thank you,

Hi @Toolie,

you have many redirections in the Apache’s configuration and that’s probably why you can’t access phpMyAdmin. Could you please run this command inside the instance?

curl -LIk localhost/phpmyadmin

I understand you need to configure Putty to use port 8888 locally and 443 (not 80) in the instance. After that, you will need to use https://localhost:8888/phpmyadmin to connect to the app.

The only thing I have added to the Apache configuration are links to the virtual hosts file and the Joomla htaccess content. I haven’t added my Let’s Encrypt certificates since they need to be regenerated.

Here are the results of that command:

bitnami|~ $ curl -LIk localhost/phpmyadmin
curl: (7) Failed to connect to localhost port 80: Connection refused
bitnami|~ $

I did reconnect just now using the local port 8888 and remote as localhost:80 THEN used http://localhost:8888/phpmyadmin and the page came up. However, trying to use “root” as the user and the designated app password, I got this:

phpmyadmin-access-denied

Is this something we can correct at the command line so I can get access?

You can always use the mysql command line tool to connect to the database

mysql -u root -p

Here’s what I get when I connect to MySQL/MariaDB after the instance starts up (I shut it down overnight until it’s completely set up).

bitnami|~ $ mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local server through socket '/opt/bitnami/mariadb/tmp/mysql.sock' (2)
   
bitnami|~ $ sudo /opt/bitnami/ctlscript.sh start mariadb
Started mariadb

bitnami|~ $ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.6.5-MariaDB Source distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> exit
Bye
bitnami|~ $

So it appears that MariaDB is not running when this instance starts up. Where do I go on the instance to fix this issue?

Also, what would be the command to fix the root@localhost using password YES problem?

Please note that the services take some time to be started when booting the machine. There is one process that monitors the status of the services

sudo gonit status

It should start all services after waiting for some time.

If you can access the database using the command line, you shouldn’t have problems accessing it using phpMyAdmin.

The only way I was able to log into the database was to sudo in. My past experience is that it’s not necessary to use sudo at the command line for mysql, as you indicated above. The password worked when I used it at the command line, but I cannot connect to PHPMyAdmin. In fact I cannot even get the page to come up anymore.

Jota I’ve spent nearly 30 hours and filed 3 tickets trying to get this instance to work. Is it possible at all that there’s something wrong with your Bitnami 8.1.1-8 LAMP stack?

I started a new instance using your 8.0.15-1 LAMP stack and I am STILL unable to log into PHPMyAdmin. I can access MariaDB with the generated password. This time I don’t have to sudo at the command line, but I still get this error.

phpmyadmin-access-denied-full

Once logged into PHPMyAdmin, I know how to manipulate the user permissions, but I cannot find a solution at the command line. All of the references I’ve viewed assume the password is wrong, but we know it’s not. Can you please tell me how to change the permissions (root@localhost using password YES) at the command line so I can log into PHPMyAdmin? Thank you Jota!

Update: I found this article: https://devanswers.co/phpmyadmin-access-denied-for-user-root-localhost/#method-2-change-root-authentication-method

I logged in at the command line and checked to see what the authentication plugin was based on the suggestion in the article.

MariaDB [(none)]> SELECT user,plugin,host FROM mysql.user WHERE user = 'root';
+------+-----------------------+------+
| User | plugin                | Host |
+------+-----------------------+------+
| root | mysql_native_password | %    |
+------+-----------------------+------+
1 row in set (0.001 sec)

I made no changes to the setting but I did try the following command and it WORKED.

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> exit

I am now able to log into PHPMyAdmin, and I have no idea why, but I thought you should know.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.