'How to enter adminer without password? [closed]

Using adminer-4.7.2-mysql.php on my home laptop with Kubuntu 18 is there is a way to login to it without password entering? Or session time as long as possible ?

Thanks!



Solution 1:[1]

Adminer doesn't allow connection without password for security reasons.

If you want to login without password because you're working in local environment you must use the login-password-less plugin.

1. Install adminer default core file

Download the adminer core file PHP:

wget https://github.com/vrana/adminer/releases/download/v4.7.5/adminer-4.7.5.php

Then rename it to adminer_core.php:

mv adminer-4.7.5.php adminer_core.php

Access to this adminer file from web browser and test login without password.
You can see the error message from Adminer by default: Adminer error message login without password not allowed

2. Install plugins

To use plugins with Adminer you need to install the plugin autoloader file:

mkdir plugins
cd plugins
wget https://raw.githubusercontent.com/vrana/adminer/master/plugins/plugin.php

Then install the login password less plugin into plugins directory:

wget https://raw.githubusercontent.com/vrana/adminer/master/plugins/login-password-less.php

3 Configure your Adminer password

Last step is to define a password that will not be use for MySQL connection but only for Adminer authentification:

nano adminer.php

In this file copy/paste the following code and replace YOUR_PASSWORD_HERE by any password you want:

<?php
function adminer_object() {
    include_once "./plugins/plugin.php";
    include_once "./plugins/login-password-less.php";
    return new AdminerPlugin(array(
        // TODO: inline the result of password_hash() so that the password is not visible in source codes
        new AdminerLoginPasswordLess(password_hash("YOUR_PASSWORD_HERE", PASSWORD_DEFAULT)),
    ));
}
include "./adminer_core.php";

4. That's it!

Now you can access to http://localhost/adminer.php and authenticate yourself with the previous password you have set in adminer.php.

In resuming you have the following architecture:

? localhost
  ? adminer.php
  ? adminer_core.php
  ? plugins
    ? login-without-password.php
    ? plugin.php

Enjoy! ????

Solution 2:[2]

If anyone is still looking for a quick workaround for this please follow the below instructions.

  1. Open the downloaded adminer.php file in any text editor.
  2. Use the find command to find the login method it will kinda look like this one.Login($ye,$F){if($F =="") return
  3. Type anything between "" double quotes like "abc" and save the file.

That's it problem Solved. You can now login to adminer without a password.

Solution 3:[3]

If you want to login without a password because you're working in the local environment

  1. Install the latest admirer https://github.com/vrana/adminer

  2. Open file adminer.php

  3. Search and change from login($ze,$F){if($F=="")return to login($ze,$F){if(1==1)

  4. type root in field username and click login

  5. Now you can access adminer without a password

Solution 4:[4]

I tried above methods but did not work for me so I did the following which works in 2021 for Adminer 4.7.9.
WARNING: Please note that its only for your local machine & not advised for online databases.:
Step-1: Download Adminer source from Github, this link.
Step-2: Open adminer-master\adminer\include\auth.inc.php
Step-3: Edit the following at lines 55 to 57 & replace my_username & my_password with your MySQL credentials:

$server = "localhost";  //$auth["server"];
$username = "my_username";    //$auth["username"];
$password = "my_password"; //(string) $auth["password"];

Step-4: Save & now open Adminer by pointing your browser to "adminer-master\adminer"
Step-5: Just click Login button & you will login without entering anything.

Solution 5:[5]

/*******************************************************
** Adminer, since version 4.7.0 does not accept        *
** connections without a password.                     *
** For version 4.7.x to accept an empty password,      *
** in the adminer-4.7.x.php file, replace :            *
** login($Ae,$F){if($F=="") by login($Ae,$F){if(1===2) *
** This can be done automatically by replacing false   *
** with true in the line below.                        *
*******************************************************/
$AcceptEmptyPassword = true;

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Antoine Subit
Solution 2
Solution 3 ega rifs
Solution 4 MyO
Solution 5 Adriaan