Spyrule's picture

So it's created/populated on install, and it seems as though the Magento DB user has a pre-created password (that doesn't seem to match the password I set on initial setup).

How do I find out the pre-existing password for that user?

Forum: 
Jeremy Davis's picture

Perhaps there's a bug? You should be able to log in with the user ("admin" IIRC) and the password that you set at firstboot.

Where are you running this from? If you are using a VM build of some sort could you please test the previous version (v14.0)? It can be downloaded from the mirror. E.g. the OVA build is here: http://mirror.turnkeylinux.org/turnkeylinux/images/ova/turnkey-magento-1...

I'll have a look ASAP and post back when I have something of value...

Spyrule's picture

I can log in with the Admin user, but I am using this on an ESXi server for internal use (testing). I'm currently using this Image as a base image to import our current production website, and then proceed to go through the upgrade proceedure from 1.7 to 1.9.  To make my life easier, it would be nice if I can re-use the "magento" user that exists within the MySQL database (that is then pointed to the magento Db).  I only need the password for the "magento" user so that I can complete the import of my production site into the test environment.

I am running the v14 OVF btw, so it is the latest version. It just seems that the default Magento 1.9 installation is installed using a Db user called magento.  I've tried grabbing the password from the \var\www\magento\app\etc\local.xml file, but I beleive that password is hashed as it is not working.

Jeremy Davis's picture

Ok I get you now. Sorry for the confusion!

The Magento DB user password is auto generated on first boot so I have no idea what yours is! FWIW the code that generates the password on firstboot is here. From my reading it should be stored in plain text (i.e. not encrypted) against the "password" field in the conf xml (var\www\magento\app\etc\local.xml). However perhaps Magento encrypts it itself when it starts?

Without having a tinker with it myself (I've downloaded it but still haven't had a chance to get any further than that) I have a few my suggestions:

  • tweak the 20regen-magento-secrets script so that it displays the password that it sets in the console. To do that you'll need to add the x switch to the script's shebang and re-run it. I.e. edit the first line of it so it looks like this instead:
    #!/bin/bash -ex
    So the whole process will look like this:
    nano /usr/lib/inithooks/firstboot.d/20regen-magento-secrets
    # update first line of script then exit and save
    /usr/lib/inithooks/firstboot.d/20regen-magento-secrets
    
  • Or leverage the root MySQL user to manually update the magento user password. You'll also need to update the password in the Magento conf too (so it can connect to the DB). TBH I'm not sure of the implications there but seeing as this is a test I guess worst case scenario you could re-run the initialisation ("turnkey-init") to reset it again.
  • Or just create a new DB user for your imported site.
  • Add new comment