Cannot connect to the database

Operating system: Ubuntu
OS version: 20.04

Hi,
I download a codecanyon project to install on my site. The project needs to be connected to MySQL. I install PHPMyAdmin and make sure MySQL was running. I configure the project and I got Could not connect to the database. Please check credentials.
I check my credentials and if I’m not wrong my credentials seem good:
This is what I did:

Host: mysite.com/phpmyadmin
Username: MySQL username
password: MySQL

I try another project that also required to login to PHP and I still get this.
I then use a free website hoster base on C-Panel and the project is working so I know the problem is my server and not the script.

How could fix it?

Hi. Problem is the script not the server nor virtualmin. Script was developed to run on cpanel and Windows environments not native on Linux os, well without cpanel modifications. Considering contacting your paid script supplier for support, ask there. It’s not your server it’s how code is written.

Ubuntu 20.04 and MySQL 8 under any version of PHP less than 7.4 throw the error:
Connect Error (2054) The server requested authentication method unknown to the client

@Daniel_Server could you check to see if this is the error you get?

@calport
Nop I got this:

[Wed Mar 10 16:24:02.887818 2021] [fcgid:warn] [pid 735777] [client 162.158.126.119:61054] mod_fcgid: stderr: Next PDOException: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/website/public_html/admin/classes/database.class.php:13
[Wed Mar 10 16:24:02.887824 2021] [fcgid:warn] [pid 735777] [client 162.158.126.119:61054] mod_fcgid: stderr: Stack trace:
[Wed Mar 10 16:24:02.887829 2021] [fcgid:warn] [pid 735777] [client 162.158.126.119:61054] mod_fcgid: stderr: #0 /home/website/public_html/admin/classes/database.class.php(13): PDO->__construct()
[Wed Mar 10 16:24:02.887835 2021] [fcgid:warn] [pid 735777] [client 162.158.126.119:61054] mod_fcgid: stderr: #1 /home/website/public_html/system/db.php(7): database::connect()
[Wed Mar 10 16:24:02.887841 2021] [fcgid:warn] [pid 735777] [client 162.158.126.119:61054] mod_fcgid: stderr: #2 /home/website/public_html/system/config.php(3): require_once(’/home/websi…’)
[Wed Mar 10 16:24:02.887847 2021] [fcgid:warn] [pid 735777] [client 162.158.126.119:61054] mod_fcgid: stderr: #3 /home/website/public_html/index.php(2): in /home/website/public_html/admin/classes/database.class.php on line 13

And this is the file database.class.php nothing looks strange. This is a link if you want to download database.class.php: 14.2 KB file on MEGA

Hmm. I’m shooting in the dark here, but replace localhost with 127.0.0.1 for the MySQL hostname

I get exactly this error?
I use ubuntu 20.04 with MySQL 8 and I need to use PHP less than 7.1.
My problem is described here https://www.virtualmin.com/node/69211.
Please any advice??

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.