How can I recover the database password?

  • Hi, I'm on the proces of migration from ispcp and somehow I managed to screw the admin password.
    The admin user for my database is 'ispcp' (cause i'm migrating from there), where's that info located? And can I change that (i'd like to change both the user and the password)


    Code
    1. [ERROR]
    2. Error while performing step:
    3. i-MSCP default SQL data:
    4. Error was:
    5. Error while executing query: UPDATE command denied to user "ispcp"@"localhost" for table "server_ips"
    6. To obtain please use http://i-mscp.net/forum
  • If you've screwed up the password then there is no way to recover it from anywhere. However, you can change it directly from within mysql. You can use the "debian-sys-maint" user (its password is in the /etc/mysql/debian.cnf file) to login to mysql with admin rights, and fiddle with the user and privileges from there. One-liner for the login:

    Code
    1. mysql -udebian-sys-maint -p`grep password /etc/mysql/debian.cnf|head -n1|awk '{print $3}'`


    I would recommend you to delete the current user, create a new one, give it rights to access the ispcp database, and then use that info in the installer.

    Edited once, last by kilburn ().


  • If you've screwed up the password then there is no way to recover it from anywhere. However, you can change it directly from within mysql. You can use the "debian-sys-maint" user (its password is in the /etc/mysql/debian.cnf file) to login to mysql with admin rights, and fiddle with the user and privileges from there. One-liner for the login:

    Code
    1. mysql -udebian-sys-maint -p`grep password /etc/mysql/debian.cnf|head -n1|awk '{print $3}'`


    I would recommend you to delete the current user, create a new one, give it rights to access the ispcp database, and then use that info in the installer.


    I've done the user change, but still, the problem is that the second time you run the installer you are not asked anymore for the username and the password for the database. So I cannot fix my mistake.
    [hr]
    The problem I'm having is that imscp retains the wrong password after the first run of imscp-setup, so I cannot reenter it. I'd like to wipe/change that information from the ispcp setup.

    Edited once, last by aseques ().


  • is there nothing in /etc/imscp/imscp.conf


    DATABASE_*


    /J


    Yes, there is a ciphered text in DATABASE_PASSWORD, if I delete the string and run again the imscp-setup, the error is again the same. And the passwords are back to the ciphered ones.

  • password are tested from both imscp.conf and from imscp.old.conf. If you want replace you must replace in both. Also user need full access not just access to imscp database

    Edited once, last by oldev01 ().