Adding DB finctionality on web server only

Discussion in 'ISPConfig 3 Priority Support' started by Stelios, Nov 19, 2024 at 12:25 PM.

  1. Stelios

    Stelios Active Member HowtoForge Supporter

    Hi all,

    I got on a multi server setup a web server which now I want to add to it Mariadb in order to work as a db server too.
    What is the proper way to achieve this?
    I assume that I have to install the mariadb packages first and then re-run the update.sh script?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    MariaDB should be installed already, as it's a system requirement for any ISPConfig node. All you have to do is to enable DB server under system > server services.
     
    Stelios likes this.
  3. Stelios

    Stelios Active Member HowtoForge Supporter

    Hi Till, I did what you mentioned and is adding fine the DB and the user but once I try to login with the user credentials it doesn't work at all; The DB does not appear under the user at all.
    If I log in with a root user I can see the database.

    Any ideas?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    So the database is there and the user is there when you check in phpmyadmin as root user? Then you must check with phpmyadmin if the database is assigned to the user in mysql.

    Just a guess, maybe you added that user manually in phpmyadmin before or something similar, as iSPConfig can not manage existing users or databases you added in mysql outside of ISPConfig.
     
  5. Stelios

    Stelios Active Member HowtoForge Supporter

    I've added the user via the ISPconfig interface and asign it to a new db.
    Then I logged in as root user on phpmyadmin and import the db. Then I logged out and tried to login with the user and getting authentication error.
    I logged in afterwards directly to the server with ssh and into mysql (mysql -u username -p) and worked fine but there are no databases at all there; show databases; query returns nothing.
     
  6. Stelios

    Stelios Active Member HowtoForge Supporter

    Also forgot to mention that the user is there with USAGE privileges but is not assigned to the DB.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Create a new user and new DB, wait until the changes have been applied, then use phpmyadmin to login with the username and password and check if the database is there. Maybe your database dump that you imported as root contained queries that altered the user
     
  8. Stelios

    Stelios Active Member HowtoForge Supporter

    ok I've done that and I can log in with the user but there is no database displayed in phpmyadmin.
    The database is however there if I logged with any other account that has root access.
     
  9. Stelios

    Stelios Active Member HowtoForge Supporter

    I'm getting in logs that user is denied eventhough the password is correct. That is under logs when it tried to sync/add the db.
    Can you share please the proper queries that I have to run to the master(who holds the phpmyadmin and the controlpanel) and the server which I'm trying to add the database? Just to check with those that I got in place as it should be working without a problem but it doesn't; it doesn't create at all the db.

    Code:
    Unable to connect to mysql: Access denied for user 'myuser'@'localhost' (using password: YES)
     
    Last edited: Nov 21, 2024 at 1:29 PM
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    The queries get dynamically created based on your MariaDB or MySQL version. You can find the code in /usr/local/ispconfig/server/plugins-available/mysql_clientdb_plugin.inc.php
     

Share This Page