Fatal Error when trying to go onto localhost/openemr

Situation
My Problem is that when i run apache and mysql and then go to localhost/openemr i get a fatal error saying:
Fatal error : Uncaught TypeError: mysqli_query(): Argument #1 ($mysql) must be of type mysqli, bool given in C:\xampp\htdocs\openemr\vendor\adodb\adodb-php\drivers\adodb-mysqli.inc.php:1372 Stack trace: #0 C:\xampp\htdocs\openemr\vendor\adodb\adodb-php\drivers\adodb-mysqli.inc.php(1372): mysqli_query(false, 'SET NAMES ‘utf8…’, 0) #1 C:\xampp\htdocs\openemr\vendor\adodb\adodb-php\adodb.inc.php(1613): ADODB_mysqli->_query('SET NAMES ‘utf8…’, false) #2 C:\xampp\htdocs\openemr\vendor\adodb\adodb-php\drivers\adodb-mysqli.inc.php(1115): ADOConnection->_Execute('SET NAMES ‘utf8…’) #3 C:\xampp\htdocs\openemr\library\ADODB_mysqli_log.php(60): ADODB_mysqli->execute('SET NAMES ‘utf8…’, false) #4 C:\xampp\htdocs\openemr\library\sql.inc.php(66): ADODB_mysqli_log->ExecuteNoLog('SET NAMES ‘utf8…’) #5 C:\xampp\htdocs\openemr\interface\globals.php(301): require_once(‘C:\xampp\htdocs…’) #6 C:\xampp\htdocs\openemr\interface\login\login.php(41): require_once(‘C:\xampp\htdocs…’) #7 {main} thrown in C:\xampp\htdocs\openemr\vendor\adodb\adodb-php\drivers\adodb-mysqli.inc.php on line 1372

OpenEMR Version
I’m using OpenEMR version 7.0.1

Browser:
I’m using: google chrome

Operating System
I’m using: windows 11

Search
Did you search the forum for similar questions?
yes none of the questions helped me

Logs
Did you check the logs?
no i did not
Was there anything pertinent in them?
Please paste them here (surround with three backticks (```) for readability.
You can also turn on User Debugging under Administration->Globals->Logging User Debugging Options=>All

@hackerkid_119 Hi i hope that you are doig well, just quick qustion where did you download your openemr, was it from github or the offical website.

Along with that can you please shre with me your xampp php and sql version number.

If I assume that you downlaoded the openemr from github try to downalod the stable version from offical website OpenEMR Downloads - OpenEMR Project Wiki sometimes the unstable version it cause the error messsage.

1 Like

Hi,
im at my work and will get back to you asap but the only thing i do know is that i got it on openemr here on scourgeforge where openemr stores the files. 7.0.2 would not work for setup but 7.0.1 would work just fine.

@mkm1971 * Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.1.25

  • Database client version: libmysql - mysqlnd 8.1.25
  • PHP version: 8.1.25
  • Server: 127.0.0.1 via TCP/IP
  • Server type: MariaDB
  • Server connection: SSL is not being used
  • Server version: 10.4.32-MariaDB - mariadb.org binary distribution
  • Protocol version: 10
  • User: root@localhost
  • Server charset: UTF-8 Unicode (utf8mb4)

update: i also found on mysql that when i look at the database of openemr i see this errror

Cannot connect: invalid settings.

mysqli::real_connect(): (HY000/2002): No connection could be made because the target machine actively refused it

= Connection for controluser as defined in your configuration failed.
mysqli::real_connect(): (HY000/2002): No connection could be made because the target machine actively refused it

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
retry to connect

Yes, I agree with :point_right: @hackerkid_119.

I also faced this issue and I have followed same process that he mentioned.

You can also try this :point_right: Can't acess localhost/openemr

Hope this will help you.