MySQL: Access denied for user 'root'@'localhost' , but ONLY when creating dbusers

Discussion in 'General' started by axxies, Sep 24, 2020.

  1. axxies

    axxies Member

    I get this error in ISPconfig:

    "Unable to connect to mysqlAccess denied for user 'root'@'localhost' (using password: YES)"

    The thing is that it happens ONLY when I create a new dbuser, not if I create a database with an existing dbuser so
    the correct password is set in "/usr/local/ispconfig/server/lib/mysql_clientdb.conf" so that seem to not be the problem.

    Anyone who has had this problem before? Any hints on what can be the problem?
     
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Where do you see that error, in the gui or a log? Is this a single-server system or multi-server? What version?

    Guesses: something in name resolution isn't quite right between your mysql.user and mysql.db entries and what 'hostname' returns and what's in /etc/hosts. Maybe you disabled name resolution in mysql? Um... not sure, it's odd that it would only happen during that specific event.

    You might enable server debugging and see what ouput you get from server.sh when making such a change.
     
  3. axxies

    axxies Member

    Apparently the dbuser is not really associated with the database. I have to do a manual GRANT ALL PRIVILEGES for command line MySQL for it to work.

    This is a really weird problem.

    Names in /etc/hosts and /etc/hostname is ok
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Which MySQL or MariaDB version do you use in conjunction with which ISPConfig version?
     
  5. axxies

    axxies Member

    These:

    mysql Ver 15.1 Distrib 10.1.45-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

    ISPConfig Version: 3.1.15p3
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    That combination should be ok. Check the mysql.user table if you have multiple root users on that slave node to see if any of that root users lacks the grant privilege.
     
  7. axxies

    axxies Member

    root in that table has all rights. No additional root user there.

    Slave node? This is a standalone server. I wish I knew how to connect them, but I don't :)
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Ah, ok, Thought you have a multiserver system.

    That's described in the ISPConfig multiserver installation guides.
     
  9. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    You could run update.php from the installation source and answer yes to reconfiguring permissions on the database as well as reconfiguring services, it wouldn't hurt anything and might correct the problem.
     
  10. axxies

    axxies Member

    How do I do that?
    Sorry for the noob question. I tried to do that yesterday with the same thought in mind, but I just got a message saying there there were no updates.
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you try to search for the answer? We answer that question about once a week here in the forum. The answer is:

    Code:
    cd /tmp
    wget https://www.ispconfig.org/downloads/ISPConfig-3.1.15p3.tar.gz
    tar xvfz ISPConfig-3.1.15p3.tar.gz
    cd ispconfig3_install/install
    php -q update.php
     
  12. axxies

    axxies Member

    Thanks.
    No, I did not search for it. For some reason I have problems in accessing this website too. Access I can, but the CSS is gone. I have tested it in FF, Edge (Chromium), Chrome, even SeaMoney Navigator. It's REALLY hard tro use it without CSS. I am sorry.

    Running the above code ends in this:

    It results in this:

    <snip>
    Updating Crontab
    Restarting services ...
    PHP Warning: Packets out of order. Expected 1 received 0. Packet size=30 in /tmp/ispconfig3_install/install/lib/mysql.lib.php on line 205
    Update finished.
    </snip>

    On line 205 there is this:
    " $ok = mysqli_ping($this->_iConnId);"
     
  13. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Do you have production data, or is this a new/test setup? If not new, was this ever working in the past? It wouldn't hurt to run a check/repair of your db tables, though I don't know if your symptoms would be caused by corruption or not.
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    CSS is showing up fine for me. Changed some settings now, please reload the page, is CSS working again now for you?
     
  15. axxies

    axxies Member

    New, but it is already running with a few sites in production.
    It "must" have worked since I was able to create dbusers under the first client ID. What I did now was to try to create under other client IDs but that didn't work. On the other hand it doesn't work to create new db users under the first client ID either.
     
  16. axxies

    axxies Member

    Yes, NOW CSS is working fine (from my response to Jesse above). Thanks!
     
  17. axxies

    axxies Member

    # mysqlcheck -u root -p --auto-repair --check --all-databases

    resulted in all databases being ok
     

Share This Page