Menu

#799 A strange bug in Wiki 'Enable sqlite3'

4.8.1
closed-works-for-me
nobody
None
4
2025-02-19
2021-05-15
Wang Xi'ao
No

https://github.com/vrana/adminer/wiki/Enable-sqlite3
I decided to enable sqlite in adminer follow it, but I could not connect to my sqlite file, so I looked at how the main branch did.
It was set to new AdminerLoginPasswordLess(password_hash("YOUR_PASSWORD_HERE", PASSWORD_DEFAULT)),, while the Wiki was set to new AdminerLoginPasswordLess("sladmin", password_hash("mypassword", PASSWORD_DEFAULT)), and I thought maybe bug happened in that place.
I mean, if I use the Wiki setting (User:sladmin, Password:mypassword), I get the message that 'Database does not support password.', but if I use the main branch setting (User:admin, Password:YOUR_PASSWORD_HERE), I will be able to connect to my file.
And I also tried to change 'sladmin' to 'admin' to see if it was the problem of wrong username but stiil got the error massage.

So, it seems that there shouldn't be a username in AdminerLoginPasswordLess if you want to enable sqlite.

Discussion

  • Hem Roy

    Hem Roy - 2021-05-21

    This may help you,

    function adminer_object() {
    
      include_once "plugins/plugin.php";
      include_once "plugins/login-password-less.php";
    
        class AdminerCustomization extends AdminerPlugin {
            function loginFormField($name, $heading, $value) {
                return parent::loginFormField($name, $heading, str_replace('value="server"', 'value="sqlite"', $value));
            }
    
            function database() {
                return "hem.db";//the target folder here is the home folder
            }
        }
    
        return new AdminerCustomization(array(
            // TODO: inline the result of password_hash() so that the password is not visible in source codes
            //password will be anything, but you will still need to type password
            //on the form during login, then the password will be here for example 1234
            new AdminerLoginPasswordLess(password_hash("1234", PASSWORD_DEFAULT)),
        ));
    }
    include "adminer-4.8.1-en.php";
    

    This for sure will solve the problem, to log in to sqlite database.

     
  • Jakub Vrána

    Jakub Vrána - 2025-02-19
    • status: open --> closed-works-for-me
     
  • Jakub Vrána

    Jakub Vrána - 2025-02-19

    You are supposed to set your own password.

     

Log in to post a comment.

MongoDB Logo MongoDB