How to enter adminer without password?

10,153

Solution 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

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

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

Share:
10,153
mstdmstd
Author by

mstdmstd

Updated on June 13, 2022

Comments

  • mstdmstd
    mstdmstd about 2 years

    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!