Sql setting server

Discussion in 'ISPConfig 3 Priority Support' started by DavideR, Feb 12, 2019 at 12:00 PM.

  1. DavideR

    DavideR New Member HowtoForge Supporter

    Hi all,
    I've a problem with my Isp Server.
    I've create a site, Db dbuser and ftp access.
    I've imported sql dump from old to new db and copy all site file under correct folder.
    I've edit the sql setting in my dbh.inc.php file but I get this error Connection failed: Host 'server....' is not allowed to connect to this MariaDB server
    under file setting i've setup any type of fqdn or ip or localhost but not working on any cases.
    can anyone help me?

    ps sorry for my english
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Is the database on the same server than the web server, or is it on a different server?
     
  3. DavideR

    DavideR New Member HowtoForge Supporter

    is in the same server
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, so please try to connect to the mysql server on the shell

    mysql -h localhost -u username -p database

    and

    mysql -h 127.0.0.1 -u username -p database

    Replace in both commands the word username with the actual username and the word database with the name of the database. The command will ask for the password then.
     
  5. DavideR

    DavideR New Member HowtoForge Supporter

    under shell using the first command i can connect on db as the same as second command
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, so the database and user must be fine then. When you are not able to connect with the same credentials (hostname/ip, user and password) from your web app, then there must be a problem with your web application or the web application is missing a database library or you have chosen a PHP version for that website which is too new for the used web application.
     
  7. DavideR

    DavideR New Member HowtoForge Supporter

    mmmm probably is php to old on server, it's 7.0.33, how to update to 7.3?
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Don't upgrade the main php version of the OS. If you need newer or older PHP versions, then install them as additional PHP versions and add them in ISPConfig as additional PHP so that you can select them in the site. The exact installation procedure of such an additional PHP depends on the OS that you use.
     
  9. DavideR

    DavideR New Member HowtoForge Supporter

    Sorry for delay,
    I've Debian on board
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

  11. DavideR

    DavideR New Member HowtoForge Supporter

    nothing to do, now if I setting up PHP 7.1 or 2 or 3 over 7.0 I get Service Unavailable, when return to 7.0 i get this error
    Connection failed: Host 'hostname server' is not allowed to connect to this MariaDB
    I've to add an info. this site isn't the primary fqdn but a second domain on ispconfig panel
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Why does your application use the server hostname and not localhost? Are you sure that you are using localhost or IP 127.0.0.1 for the MySQL connection? The server hostname should not be used there.

    If you have to use the server hostname or an external IP to connect to instead of localhost, then you have to enable the "Remote Access" checkbox in the database settings to allow that and your MySQL/MariaDB server must listen on the external interface too and not just on localhost.
     
  13. DavideR

    DavideR New Member HowtoForge Supporter

    for specific sql connection I've set localhost as default.
    can you connect to my server and help me ? I've no problem to give you the access
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

  15. DavideR

    DavideR New Member HowtoForge Supporter

    another question is about FTP connection, I've setup the user Ftp under isp panel, if I use ftp under my local network i can connect to host and work on folder, when i try the same outside my local network i get an error on certificate and i can't use ftp.
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you try to enable remote access for the database like I suggested, does it work then?
     
  17. DavideR

    DavideR New Member HowtoForge Supporter

  18. till

    till Super Moderator Staff Member ISPConfig Developer

    It might be that your router or firewall blocks the FTP passive ports https://www.faqforge.com/linux/cont...ange-in-pure-ftpd-on-denian-and-ubuntu-linux/ or that you must define ForcePassiveIP in pure-ftpd.
     
  19. DavideR

    DavideR New Member HowtoForge Supporter

  20. till

    till Super Moderator Staff Member ISPConfig Developer

    You can use this command to check if MySQL listens on all interfaces:

    netstat -tap | grep mysql
     

Share This Page