No database drivers (sqlite, mysql, or postgresql) installed error

I’m installing nextcloud on an ubuntu server and getting the following error message:

  • No database drivers (sqlite, mysql, or postgresql) installed.
  • PHP modules have been installed, but they are still listed as missing?Please ask your server administrator to restart the web server.

I have php installed, but when I review the possible causes for this issue I see that the mysql pdo driver is what’s needed. I can’t seem to find a recent version of this. Can anyone help with what’s needed or where I can find this?

Thank you,
Steve

Which web server do you have installed? I will assume apache2.

Which database do you have installed? I will assume mysql / Mariadb.

Which PHP version do you have installed? I will assume 8.2

In this case you would need php8.2-mysql. But first get your database running and make sure you can access it on the command line.

Are you installing by following the instructions in the Admin Manual or following some other approach?

https://docs.nextcloud.com/server/latest/admin_manual/installation/example_ubuntu.html

2 Likes

eehmke,

Thank you for the feedback. I’m using apache2 and I have mysql/Mariadb. As for php, it’s 8.2.5. How do I check if the db is running and where is this version located?

Steve

Yes, this is what I’m following, but I’m getting this error when I do the setup of the user info in mysql:

MariaDB [(none)]> CREATE USER ‘steve’@‘localhost’ IDENTIFIED BY ‘*****’;
ERROR 1396 (HY000): Operation CREATE USER failed for ‘steve’@‘localhost’

The * are in place of the password.

Steve

If it is a fresh installed database on Ubuntu, you should be able to

sudo mysql

and then create the nextcloud database and a nextcloud user. Make sure the user has only localhost privileges.

may help. You don’t need to care for the database structure, nextcloud will do it for you.

1 Like

That all works now. The user issue was my mistake. I have the DB running and have the nextcloud user setup. I feel like I’m just missing 1 part to having this running. Thank you.

Any thoughts on what could be needed still?

1 Like

I’m trying to install php8.2-mysql, but it’s telling me it cannot locate the package:

Unable to locate package php8.2-mysql

Does your Ubuntu support PHP8.2? You might need to install the sury repository (recommended)

I’m able to use php 8.2 on my version of Ubuntu.

Which version is this?

…and what does php -v and apt list --installed php* say?

Ubuntu version: Ubuntu 22.04.2 LTS

php -v and apt list --installed php*:

PHP 8.2.5 (cli) (built: Apr 14 2023 04:27:02) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.5, Copyright (c) Zend Technologies
with Zend OPcache v8.2.5, Copyright (c), by Zend Technologies

Steve

Please run apt list --installed php* as a separate command.

But not all packages, obviously. Do this:

sudo apt-cache search php | grep mysql

This tells you which mysql packages are available for which PHP version. Using the sury repository, you can install all packages that are not available in the Ubuntu repository.

php-bcmath/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-common/filecloud-23.1,now 2:93+ubuntu22.04.1+deb.sury.org+2 all [installed,automatic]
php-curl/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-gd/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-gmp/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-imagick/jammy,now 3.6.0-4ubuntu1 amd64 [installed]
php-intl/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-mbstring/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-mysql/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-xml/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php-zip/jammy,jammy,now 2:8.1+92ubuntu1 all [installed]
php7.4-common/focal-security,now 7.4.3-4ubuntu2.19 amd64 [installed,automatic]
php7.4-mysql/focal-security,now 7.4.3-4ubuntu2.19 amd64 [installed]
php8.1-bcmath/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.13 amd64 [installed,automatic]
php8.1-cli/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.13 amd64 [installed,automatic]
php8.1-common/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.13 amd64 [installed,automatic]
php8.1-curl/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.13 amd64 [installed,automatic]
php8.1-gd/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.13 amd64 [installed,automatic]
php8.1-gmp/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.13 amd64 [installed,automatic]
php8.1-imagick/jammy,now 3.6.0-4ubuntu1 amd64 [installed,automatic]
php8.1-intl/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.13 amd64 [installed,automatic]
php8.1-mbstring/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.13 amd64 [installed,automatic]
php8.1-mysql/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.13 amd64 [installed,automatic]
php8.1-opcache/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.13 amd64 [installed,automatic]
php8.1-readline/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.13 amd64 [installed,automatic]
php8.1-xml/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.13 amd64 [installed,automatic]
php8.1-zip/jammy-updates,jammy-security,now 8.1.2-1ubuntu2.13 amd64 [installed,automatic]
php8.2-bcmath/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-cli/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-common/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-curl/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-gd/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-gmp/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-gnupg/filecloud-23.1,now 1.5.1-3+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-http/filecloud-23.1,now 4.2.3-3+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-igbinary/filecloud-23.1,now 3.2.13-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-imap/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-inotify/filecloud-23.1,now 3.0.0+0.1.6-4+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-interbase/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-intl/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-ldap/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-mbstring/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-mcrypt/filecloud-23.1,now 3:1.0.5-3+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-memcache/filecloud-23.1,now 8.0+4.0.5.2+3.0.9~20170802.e702b5f9±8+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-memcached/filecloud-23.1,now 3.2.0+2.2.0-3+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-mongodb/filecloud-23.1,now 1.15.0+1.11.1+1.9.2+1.7.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-msgpack/filecloud-23.1,now 1:2.2.0~rc2-2+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-opcache/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-raphf/filecloud-23.1,now 2.0.1+1.1.2-14+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-readline/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-soap/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-solr/filecloud-23.1,now 2.6.0+2.4.0-3+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-tidy/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-xml/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-xmlrpc/filecloud-23.1,now 3:1.0.0~rc3-5+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2-xsl/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 all [installed]
php8.2-zip/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.2/filecloud-23.1,now 8.2.5-1+ubuntu22.04.1+deb.sury.org+1 all [installed]

After running that I get:

php-mysql - MySQL module for PHP [default]
php8.1-mysql - MySQL module for PHP
php-mariadb-mysql-kbs - Knowledge base about MariaDB and MySQL server variables
php-mdb2-driver-mysql - mysql MDB2 driver
php7.4-mysql - MySQL module for PHP

Are the Sury PPAs still active on your system?

Whats the output of…

cat /etc/apt/sources.list

and

cat /etc/apt/sources.list.d/*

Any errors when running sudo apt update ?

cat /et/apt/sources.list:

# deb cdrom:[Ubuntu 22.04.2 LTS _Jammy Jellyfish_ - Release amd64 (20230223)]/ jammy main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ jammy main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ jammy universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy universe
deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ jammy multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy multiverse
deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu jammy-security main restricted
# deb-src http://security.ubuntu.com/ubuntu jammy-security main restricted
deb http://security.ubuntu.com/ubuntu jammy-security universe
# deb-src http://security.ubuntu.com/ubuntu jammy-security universe
deb http://security.ubuntu.com/ubuntu jammy-security multiverse
# deb-src http://security.ubuntu.com/ubuntu jammy-security multiverse

cat /etc/apt/sources.list.d/*:

# this file was generated by packagecloud.io for
# the repository at https://packagecloud.io/AllToMP3/alltomp3

deb [signed-by=/etc/apt/keyrings/AllToMP3_alltomp3-archive-keyring.gpg] https://packagecloud.io/AllToMP3/alltomp3/ubuntu/ jammy main
deb-src [signed-by=/etc/apt/keyrings/AllToMP3_alltomp3-archive-keyring.gpg] https://packagecloud.io/AllToMP3/alltomp3/ubuntu/ jammy main
# this file was generated by packagecloud.io for
# the repository at https://packagecloud.io/AllToMP3/alltomp3

deb [signed-by=/etc/apt/keyrings/AllToMP3_alltomp3-archive-keyring.gpg] https://packagecloud.io/AllToMP3/alltomp3/ubuntu/ jammy main
deb-src [signed-by=/etc/apt/keyrings/AllToMP3_alltomp3-archive-keyring.gpg] https://packagecloud.io/AllToMP3/alltomp3/ubuntu/ jammy main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] http://dl.google.com/linux/chrome-remote-desktop/deb/ stable main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] http://dl.google.com/linux/chrome-remote-desktop/deb/ stable main
deb [ arch=amd64 signed-by=/usr/share/keyrings/filecloud.gpg ] https://repo.filecloudlabs.com/apt/ubuntu jammy/filecloud/23.1 main
deb http://security.ubuntu.com/ubuntu focal-security main
deb http://security.ubuntu.com/ubuntu focal-security main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main
# deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse
# deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse
# deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.4 multiverse
deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.4 multiverse
deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse
deb [arch=amd64,arm64] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse
# This file makes sure that Opera Browser is kept up-to-date
# as part of regular system upgrades

deb https://deb.opera.com/opera-stable/ stable non-free #Opera Browser (final releases)
# This file makes sure that Opera Browser is kept up-to-date
# as part of regular system upgrades

deb https://deb.opera.com/opera-stable/ stable non-free #Opera Browser (final releases)
deb https://ppa.launchpadcontent.net/papirus/papirus/ubuntu/ jammy main
# deb-src https://ppa.launchpadcontent.net/papirus/papirus/ubuntu/ jammy main
deb https://ppa.launchpadcontent.net/papirus/papirus/ubuntu/ jammy main
# deb-src https://ppa.launchpadcontent.net/papirus/papirus/ubuntu/ jammy main

no errors with sudo apt update.

Thank you for all the help.

And what’s in /etc/apt/sources.list.d/ ?

I suspect the Sury repos, from where you have installed PHP 8.2 in the first place, aren’t active anymore. Otherwise sudo apt install php8.2-mysql would work.

You could try the following commands to fix this…

sudo add-apt-repository ppa:ondrej/php
sudo apt install php8.2-mysql
2 Likes
cat /etc/apt/sources.list.d/*
# this file was generated by packagecloud.io for
# the repository at https://packagecloud.io/AllToMP3/alltomp3

deb [signed-by=/etc/apt/keyrings/AllToMP3_alltomp3-archive-keyring.gpg] https://packagecloud.io/AllToMP3/alltomp3/ubuntu/ jammy main
deb-src [signed-by=/etc/apt/keyrings/AllToMP3_alltomp3-archive-keyring.gpg] https://packagecloud.io/AllToMP3/alltomp3/ubuntu/ jammy main
# this file was generated by packagecloud.io for
# the repository at https://packagecloud.io/AllToMP3/alltomp3

deb [signed-by=/etc/apt/keyrings/AllToMP3_alltomp3-archive-keyring.gpg] https://packagecloud.io/AllToMP3/alltomp3/ubuntu/ jammy main
deb-src [signed-by=/etc/apt/keyrings/AllToMP3_alltomp3-archive-keyring.gpg] https://packagecloud.io/AllToMP3/alltomp3/ubuntu/ jammy main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] http://dl.google.com/linux/chrome-remote-desktop/deb/ stable main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] http://dl.google.com/linux/chrome-remote-desktop/deb/ stable main
deb [ arch=amd64 signed-by=/usr/share/keyrings/filecloud.gpg ] https://repo.filecloudlabs.com/apt/ubuntu jammy/filecloud/23.1 main
deb http://security.ubuntu.com/ubuntu focal-security main
deb http://security.ubuntu.com/ubuntu focal-security main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main
# deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse
# deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse
# deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.4 multiverse
deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.4 multiverse
deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse
deb [arch=amd64,arm64] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse
deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy main
# deb-src https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy main
# This file makes sure that Opera Browser is kept up-to-date
# as part of regular system upgrades

deb https://deb.opera.com/opera-stable/ stable non-free #Opera Browser (final releases)
# This file makes sure that Opera Browser is kept up-to-date
# as part of regular system upgrades

deb https://deb.opera.com/opera-stable/ stable non-free #Opera Browser (final releases)
deb https://ppa.launchpadcontent.net/papirus/papirus/ubuntu/ jammy main
# deb-src https://ppa.launchpadcontent.net/papirus/papirus/ubuntu/ jammy main
deb https://ppa.launchpadcontent.net/papirus/papirus/ubuntu/ jammy main
# deb-src https://ppa.launchpadcontent.net/papirus/papirus/ubuntu/ jammy main

I added the repository and installed php8.2-mysql. Is there anything I need to point Nextcloud to now?