Menu

#504 SQLite error

Git
closed-wont-fix
nobody
SQLite (29)
7
2017-07-12
2016-06-02
No

Error on intent to open a SQLite Database.
This proccess works propertly on Adminer 4.2.4, but fails on 4.2.5.

Discussion

  • Jakub Vrána

    Jakub Vrána - 2016-06-03
    • status: open --> closed-wont-fix
     
  • Jakub Vrána

    Jakub Vrána - 2016-06-03

    Adminer 4.2.5 now requires implementing the login() method to log into SQLite. https://www.adminer.org/en/extension/

     
  • SystemRevolution

    Thnx.

     
  • Peter Daly-Dickson

    Does the SQLite implementation only work if the sqlite database has username/password?

    I have followed instructions as per https://www.adminer.org/en/extension/ (in fact, I used this code), but any combination of username/password/database returns 'Invalid Credentials'.

    I'm obviosuly doing something wrong, or don't understand how it's supposed to work, but at the moment phpLiteAdmin is proving to be a far simpler and easier way to manage SQLite databases online.

    I'd heard good things about adminer though, so wanted to give it a go.

    Thanks for your help.

     
  • Jakub Vrána

    Jakub Vrána - 2017-02-15

    Adminer requires a password for SQLite database for security reasons. It's not a SQLite's password, it's Adminer's. You can specify this password in the login method of Adminer customization. You can also use the login-sqlite plugin which allows logging to SQLite without a password.

     
  • Peter Daly-Dickson

    Got it! Thanks for your help.

     
  • Krief

    Krief - 2017-06-14

    Hello,

    As a Debian's Stretch user, I've recently discovered Adminer 4.2.5 and this SQLite issue.
    Could one please detail what is exactly implied with above "specify this password in the login method of Adminer customization" ?
    Which file(s) am I supposed to overcome this ?
    Thanks in advance

    PS: Thanks for all those that contributed to Adminer as I find it very convenient to use.

     
    • SystemRevolution

      Fist, download the latest version and rename it to adminer.php, then create a new file named adminersqlite.php (or another .php if you want), then put the following code into it

      <?php
      function adminer_object(){
          class AdminerSoftware extends Adminer{
              function login($login, $password){
                  if($login!='thisUser') return false;
                  if($password!='$ECR€7') return false;
                  return true;
              }
          }
          return new AdminerSoftware;
      }
      
      require('adminer.php');
      

      Then login using thisUser as user and $ECR€7 as password.
      !!! IMPORTAN !!!
      This is an example code and you shouldn't use it as is, you have to change the user and password values for your own security.
      Good luck!

       
      • Krief

        Krief - 2017-06-19

        Hello,

        Thank you very much for replying.
        Today, I'm back from a business trip and I tried the above procedure.

        To test it, I created a debian Stretch VM, then:
        A- added sid repo with echo 'deb http://ftp.fr.debian.org/debian/ sid main' > /etc/apt/sources.list.d/sid.list; apt-get update;
        B- downloaded adminer .deb (cd /tmp/; apt-get download adminer; mv /etc/sources.list.d/sid.list /etc/sources.list.d/sid.list.disabled; apt-get update;
        C- installed adminer with dpkg -i adminer_4.3.1-1_all.deb; apt-get -f install

        From above process, which file am I supposed to rename as adminer.php ?

        Best regards

         
  • Krief

    Krief - 2017-06-29

    Hello,

    May I re-phrase my latest question as I unfortunately, could not follow SystemRevolution's "First, download the latest version and rename it to adminer.php" advice.

    Which file am I exactly supposed to download and rename as adminer.php
    (Please, appologize if this seems obvious to most but for me).

    Best regards

     
  • Krief

    Krief - 2017-06-30

    Hello,

    Using above file, I could positively connect to an SQLite3 database file on a stretch platform. Thank you very much for that !!

    Allow me to sumarize for others, my setup (I needed root access to set links within /var/www/html directory but this step is most probably not mandatory):

    1. create a HackAdminer in my home directory
    2. within this HackAdminer, have 2 files: one being adminer-4.3.1.php (from above download link), the other being adminersqlite.php as diaplayed 4 messages above.
    3. add a missing "?>" line (without quotes) at the end of adminersqlite.php and customize your login and password
    4. from a shell within HackAdminer directory, type "ln -s adminersqlite.php index.php"
    5. from a shell within HackAdminer directory, type "ln -s adminer-4.3.1.php adminer.php"
    6. from a shell within /var/www/html, type "sudo ln -s /HackAdminer adminer
    7. open a browser with "local/adminer" URL, select SQLite3, and log to adminer using your personal login and password.

    Best regards

     
  • Krief

    Krief - 2017-07-12

    Hello,

    Is there anything to be added in aconfig file to allow remote access to an Adminer instance configured as above ?

    I'm asking because I have two installed instances of Adminer: one on my laptop, one on a server. Both machines host SQLite3 databases.

    I can access to a local database on my laptop through Adminer either typing localhost or IP value (eg: http://localhost/adminer or http://198.168.1.15/adminer) in my browser address bar.
    When I type my server IP or hostname (eg: http://myserver/adminer or http://192.168.1.80/adminer) in my laptop's browser address bar, my browser screen remains blank (no message found in logs).

    If I'm not mistaken, Adminer version and config (file ownerships, modes, ...) are the same on both machines.

    (Maybe I should be openening a new thread for this but having it here may be relevant, depending on what the root cause is.)

    Any suggestion ?

    Thanks in advance

     

Log in to post a comment.