0

Hello all my name is 0xNosaj

I have a website I was given to control and move. It runs on PHP. I have only SSH access to it but I cannot seem to make the phpmyadmin site come up. How I've tried connecting are

ssh -L 8080:1.2.3.4:80 [email protected]

and

ssh -NL 3307:localhost:3306 root@REMOTE_HOST

But when I try to connect with credentials I have I get an error when I open the phpmyadmin website on my laptop.

mysqli::real_connect(): (HY000/1045): Access denied for user 'nosaj'@'localhost' (using password: YES)

I have done a GRANT ALL on [database] identified by 'PASS'; FLUSH PRIVILEGES; and restarted MariaDB. I do not have the root password for the MariaDB database but I do have root on the Linux server (Ubuntu 18.

If this is the wrong forum, if someone could kindly guide me to the correct place I'd sure appreciate it.

3
  • Because the question seems to be more about the network stuff, you could try superuser.com or serverfault.com. When you have a connection to that server Installing PhpMyAdmin does not seem to be a good plan when you do know little about this stuff, because it might get your site hacked pretty easy.
    – Luuk
    Commented Nov 23 at 16:54
  • It was already installed. I only installed it on my laptop to connnect over ssh. Commented Nov 23 at 19:28
  • look at the user list with SELECT User, Host, Password FROM mysql.user; and see if the nosaj'@'localhost exists
    – nbk
    Commented Nov 24 at 0:56

1 Answer 1

0

I would suggest using phpMyAdmin on the remote system and tunneling the web page rather than tunneling the MySQL port.

Assuming you actually have the correct password, the problem is likely related to usernames and authentication types; in MySQL there are a couple of ways of connecting and using the host field makes the distinction (so 127.0.0.1 and localhost are two different things. In your phpMyAdmin config.inc.php, I suggest switching the $cfg['Servers'][$i]['host'] field (which seems to currently be 'localhost') to '127.0.0.1'. Localhost is the default value, so you may not have that entry in your configuration at all, in which case you can add the line to override the default.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.