Menu

MySQL User Login?

Help
2015-07-03
2023-04-05
  • Dies Felices

    Dies Felices - 2015-07-03

    Hi,

    I've just started using Adminer.

    When I try to login using my MySQL login credentials via the login prompt
    on the Adminer front page. It looks like no values are passed to MySQL as
    a result Adminer reports the user as 'Logged as: @localhost'. Then I only
    have guest access.

    The only way I have found to gain access to my databases is with an
    extension, hard coding the login credentials:

     

    Last edit: Dies Felices 2015-07-03
  • Dies Felices

    Dies Felices - 2015-11-24

    Hi,

    I'm trying to log into my Database system. The PHP code I to try to achieve this is below.

    <?php
    function adminer_object() {
    
    class AdminerSoftware extends Adminer {
    
        function name() {
          // custom name in title and heading
          return  "<a href='localhost'>My App</a> Admin";;
        }
    
        function credentials() {
          $DB_USER=$_POST['auth[username]'];
          $DB_PASSWORD=$_POST['auth[password]'];
    
          // server, username and password for connecting to database
          return array('localhost', $DB_USER, $DB_PASSWORD);
        }
      }
    
      return new AdminerSoftware;
    }
    include "./adminer-4.2.3.php";
    

    When I click the login button, I'm taken to the regular page that lists databases but only datatbases which allow guest access are listed. The only way I am able to log in is to replace the return array with hard coded creds.

          return array('localhost', 'user', 'password');
    

    When using this, whether I enter no creds or the 'user' and 'password' values, hitting the login button takes me to a full list of databases. Then I'm able to use all the feature necessary features.

    I have installed an alternative web app which is able to allow login to my database out of the box. As such this striking me as it should be a simple problem to solve, only I'm not getting it.

    Thanks.

     

    Last edit: Dies Felices 2015-11-24
  • Jakub Vrána

    Jakub Vrána - 2018-02-01

    It's $_POST['auth']['username'], not $_POST['auth[username]'].

     
  • Haagen Waade

    Haagen Waade - 2023-04-05

    After alot of try/fail I found the solution to this:

    function credentials() {                                               
    $server= 'localhost';
    return array($server, $_GET["username"], get_password());
    }   
    
     

    Last edit: Haagen Waade 2023-04-05

Log in to post a comment.

MongoDB Logo MongoDB