Moodle Installation: error reading from database

Moodle Installation: error reading from database

by Fred Schmid -
Number of replies: 6
I am trying to install Moodle on my existing XAMPP Windows 11 Pro environment.  After starting the installation and answering the setup question for Moodle it stops at this page that says "Error   Error reading from database".  It does not allow me to backup in the installation or restart the installation.  I am thinking that when it asked for dbhost I left the default "localhost" but my Apache server host is "localhost:90".

How can I restart the installation to try it?  Or is there another problem?

I did already copied the Moodle folder into the htdocs folder and created a database in MySQL called moodle.

Fred



Average of ratings: -
In reply to Fred Schmid

Re: Moodle Installation: error reading from database

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
If you are trying to install Moodle 4.2, your problem might be that Moodle 4.2 requires a version of MySQL that XAMPP doesn't provide.

Is this the first time that you are trying to install Moodle in XAMPP, or have you had success in the past?

To try to restart the installation, you could "drop" all the tables from your database, delete everything in your moodledata folder, and then erase the config.php file in your moodle folder.

As another suggestion, are you sure your XAMPP meets all other moodle requires, such as the PHP extension requirements?
In reply to Rick Jerz

Re: Moodle Installation: error reading from database

by Fred Schmid -
Hi Rick,

No, this is my first time.  Never had it working before.  I am using 

XAMPP for Windows 8.2.4

Can MySQL and PHP be upgraded in XAMPP?

I did what you said ( moodle database did not have any tables,  There was stuff in the moodledata folder which I deleted, and then I deleted the config.php file in the moodle directory )

and it allowed me to run the setup again.  but after the prompts I still get the same error.

Error

Error reading from database

Fred


In reply to Fred Schmid

Re: Moodle Installation: error reading from database

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Since this is your first attempt, you might want to watch my presentation on this topic at a MoodleMoot. A lot of what I show still applies.
 

There are some database requirements of Moodle 4.2 that XAMPP doesn't fully support. Consider installing Moodle 4.1.

In reply to Rick Jerz

Re: Moodle Installation: error reading from database

by Fred Schmid -
Hi Rick,

I followed your instructions of trying 4.1. I got further than before but I am getting a lot of PHP errors saying the commands are deprecated. It looks like I will have to upgrade my PHP.

Deprecated: Creation of dynamic property cache_config_disabled::$configlockmappings is deprecated in E:\xampp\htdocs\moodle\cache\classes\config.php on line 146

Deprecated: Creation of dynamic property cache_config_writer::$configlockmappings is deprecated in E:\xampp\htdocs\moodle\cache\classes\config.php on line 146
Error
error/An error occurred whilst communicating with the server

Fred
In reply to Fred Schmid

Re: Moodle Installation: error reading from database

by Fred Schmid -
I checked my version of PHP and it says:

PHP logo
PHP Version 8.2.4
System Windows NT XXXXXXXXXXXX 10.0 build 22621 (Windows 11) AMD64
Build Date Mar 14 2023 17:50:26
Build System Microsoft Windows Server 2019 Datacenter [10.0.17763]
Compiler Visual C++ 2019
Architecture x64
Configure Command cscript /nologo /e:jscript configure.js "--enable-snapshot-build" "--enable-debug-pack" "--with-pdo-oci=..\..\..\..\instantclient\sdk,shared" "--with-oci8-19=..\..\..\..\instantclient\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--without-analyzer" "--with-pgo"
Server API Apache 2.0 Handler
Virtual Directory Support enabled
Configuration File (php.ini) Path no value
Loaded Configuration File E:\xampp\php\php.ini
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)
PHP API 20220829
PHP Extension 20220829
Zend Extension 420220829
Zend Extension Build API420220829,TS,VS16
PHP Extension Build API20220829,TS,VS16
Debug Build no
Thread Safety enabled
Thread API Windows Threads
Zend Signal Handling disabled
Zend Memory Manager enabled
Zend Multibyte Support provided by mbstring
IPv6 Support enabled
DTrace Support disabled
Registered PHP Streams php, file, glob, data, http, ftp, compress.zlib, compress.bzip2, https, ftps, zip, phar
Registered Stream Socket Transports tcp, udp, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3
Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, convert.*, consumed, dechunk, zlib.*, bzip2.*
Zend logoThis program makes use of the Zend Scripting Language Engine:
Zend Engine v4.2.4, Copyright (c) Zend Technologies
Configuration
apache2handler
Apache Version Apache/2.4.56 (Win64) OpenSSL/1.1.1t PHP/8.2.4
Apache API Version 20120211
Server Administrator postmaster@localhost
Hostname:Port localhost:80
Max Requests Per Child: 0 - Keep Alive: on - Max Per Connection: 100
Timeouts Connection: 300 - Keep-Alive: 5
Virtual Server No
Server Root E:/xampp/apache
Loaded Modules core mod_win32 mpm_winnt http_core mod_so mod_access_compat mod_actions mod_alias mod_allowmethods mod_asis mod_auth_basic mod_authn_core mod_authn_file mod_authz_core mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_dav_lock mod_dir mod_env mod_headers mod_include mod_info mod_isapi mod_log_config mod_cache_disk mod_mime mod_negotiation mod_proxy mod_proxy_ajp mod_rewrite mod_setenvif mod_socache_shmcb mod_ssl mod_status mod_version mod_php
Directive Local Value Master Value
engine On On
last_modified Off Off
xbithack Off Off
Apache Environment
Variable Value
MIBDIRS E:/xampp/php/extras/mibs
MYSQL_HOME \xampp\mysql\bin
OPENSSL_CONF E:/xampp/apache/bin/openssl.cnf
PHP_PEAR_SYSCONF_DIR \xampp\php
PHPRC \xampp\php
TMP \xampp\tmp
HTTP_HOST localhost:90
HTTP_CONNECTION keep-alive
HTTP_SEC_CH_UA "CCleaner Browser";v="113", "Chromium";v="113", "Not-A.Brand";v="24"
HTTP_SEC_CH_UA_MOBILE ?0
HTTP_SEC_CH_UA_PLATFORM "Windows"
HTTP_DNT 1
HTTP_UPGRADE_INSECURE_REQUESTS 1
HTTP_USER_AGENT Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 CCleaner/113.0.21244.129
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
HTTP_SEC_FETCH_SITE none
HTTP_SEC_FETCH_MODE navigate
HTTP_SEC_FETCH_USER ?1
HTTP_SEC_FETCH_DEST document
HTTP_ACCEPT_ENCODING gzip, deflate, br
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.9
PATH C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;E:\Program Files\Python311\Scripts\;E:\Program Files\Python311\;C:\Program Files\Microsoft MPI\Bin\;E:\Program Files\Java\jdk-20\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\PowerShell\7\;C:\Program Files\Azure Data Studio\bin;E:\Program Files (x86)\Microsoft SQL Server\160\Tools\Binn\;E:\Program Files\Microsoft SQL Server\160\Tools\Binn\;E:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;E:\Program Files\Microsoft SQL Server\160\DTS\Binn\;E:\Program Files (x86)\Microsoft SQL Server\160\DTS\Binn\;E:\Program Files\Microsoft SQL Server\150\Tools\Binn\;E:\Program Files (x86)\WinMerge;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;E:\Program Files\Git\cmd;C:\Users\fredh\AppData\Local\Microsoft\WindowsApps;C:\Users\fredh\AppData\Local\Programs\oh-my-posh\bin;C:\Users\fredh\.dotnet\tools;E:\Users\fredh\AppData\Local\Programs\Microsoft VS Code\bin;E:\Program Files\JetBrains\PyCharm Community Edition 2022.3.1\bin;
SystemRoot C:\Windows
COMSPEC C:\Windows\system32\cmd.exe
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW
WINDIR C:\Windows
SERVER_SIGNATURE Apache/2.4.56 (Win64) OpenSSL/1.1.1t PHP/8.2.4 Server at localhost Port 90
SERVER_SOFTWARE Apache/2.4.56 (Win64) OpenSSL/1.1.1t PHP/8.2.4
SERVER_NAME localhost
SERVER_ADDR ::1
SERVER_PORT 90
REMOTE_ADDR ::1
DOCUMENT_ROOT E:/xampp/htdocs
REQUEST_SCHEME http
CONTEXT_PREFIX no value
CONTEXT_DOCUMENT_ROOT E:/xampp/htdocs
SERVER_ADMIN postmaster@localhost
SCRIPT_FILENAME E:/xampp/htdocs/php_version.php
REMOTE_PORT 63129
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING no value
REQUEST_URI /php_version.php
SCRIPT_NAME /php_version.php

Isn't version 8.2.4 late enough?

Fred