Score:0

mediawiki does not find mysql

us flag

After a reinstall of Ubuntu 22.10 and copy of backup to /var/www/html/ of mediawiki-1.38.4, reinstall of PHP8 and enabling of mbstring, intl and xml in a webbrowser to localhost/mediawiki-1.38.4 the browser shows

[bbaec1736a578888733dc2ec] /mediawiki-1.38.4/index.php/ InvalidArgumentException: Wikimedia\Rdbms\Database::getClass no viable database extension found for type 'mysql'

Backtrace:

from /var/www/html/mediawiki-1.38.4/includes/libs/rdbms/database/Database.php(491)
#0 /var/www/html/mediawiki-1.38.4/includes/libs/rdbms/database/Database.php(436): Wikimedia\Rdbms\Database::getClass()
...
#32 /var/www/html/mediawiki-1.38.4/index.php(44): require(string)

index.php contains the following where line 44 is the line starting with require

define( 'MW_ENTRY_POINT', 'index' );

// Bail on old versions of PHP, or if composer has not been run yet to install
// dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
// phpcs:ignore MediaWiki.Usage.DirUsage.FunctionFound
require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
wfEntryPointCheck( 'html', dirname( $_SERVER['SCRIPT_NAME'] ) );

require __DIR__ . '/includes/WebStart.php';
wfIndexMain();

function wfIndexMain() {
    // @todo Deprecate global $mediaWiki
    // phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.allowedPrefix
    global $mediaWiki;
    $mediaWiki = new MediaWiki();
    $mediaWiki->run();
}

How shall I proceed to find and correct the error?

in flag
Silly question, but did you remember to install `php-mysql`? Without this, PHP will not be able to connect to a MySQL database
Tommy Pollák avatar
us flag
No questions are silly. Yes, php-mysql is installed and enabled in php.ini.
Score:0
us flag

Even sillier answer. MySql was not installed, makes me really ashamed. Thanks for your question, it directed me to the solution.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.