Accessing to a slave ISPConfig MySQL from a master phpMyAdmin url

Discussion in 'General' started by Sergio W., Nov 6, 2021.

  1. Sergio W.

    Sergio W. New Member

    Hi people,
    I'd like to configure my phpMyAdmin to access a slave MySSQL server installed on ISPConfig.
    I made the whole configuration, and it works pretty good, but I've to check the "Remote Access" flag on the slave in order to grant access.
    What I'd like to know, is there a way to automatically give access to the slave server from another server on the LAN, so I don't need to flag that option and open publically that host?
    Thanks!

    Regards.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The web server where the site that belongs to a database is hosted gets access automatically. But there is no function to grant another IP access automatically without having to add it in the database settings in ISPConfig. What you can do though is that you install phpmyadmin on each database server and then use something like https://[SERVERNAME]/phpmyadmin/ in the phpmyadmin URL field in ISPConfig under System > Interface > main config.IPSPconfig expands [SERVERNAME] with the right database server URL automatically then so the link to phpmyadmin in ISPConfig points to the correct server.
     
  3. Sergio W.

    Sergio W. New Member

    Thanks Till!
    This is the behavior I'm using at the moment but I'd like to not install phpMyAdmin on the MySQL slave server.
    I thought there would be something like a template I could run automatically for every MySQL user added on ISPConfig in order to execute the command to give the master server access to the slave one, using the LAN IP address.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    What you might try is this (untested), edit the file /usr/local/ispconfig/interface/web/sites/form/database.tform.php, in line 181 change:

    Code:
    'default' => '',
    to

    Code:
    'default' => '1.2.3.4',
    where 1.2.3.4 is the IP address of the master server. This should add this IP in the remote address field when you add a new database. But there are some drawbacks: first, your customer might remove it from that field and the second issue is that this change is not update-safe.

    The only other possibility is probably to write an interface or server plugin for this task.
     
    Th0m likes this.
  5. Sergio W.

    Sergio W. New Member

    Thanks for your suggestion till! I will try.
     
  6. Sergio W.

    Sergio W. New Member

    Another option could be binding the MySQL server to the LAN address and then adding the Remote Access option on ISPConfig. This could be a secure way to do this but then the ability to connect to the MySQL server from an IP outside the LAN will be impossible.
     

Share This Page