Unable to create database

Nextcloud version (eg, 20.0.5): v1.38.0 Operating system and version _(eg, Ubuntu 20.04)_: Raspbian BusterApache or nginx version _(eg, Apache 2.4.25)_: Apache/2.4.38 (Debian) PHP version _(eg, 7.4)_:PHP 7.3.29-1~deb10u1 (cli)

The issue you are facing:
I just set up a NextCloudPi server on a Pi4 from the image NextCloudPi_RPi_11-27-20.tar.bz2 and I would now like to install WordPress. The ncadmin user, however, cannot create a database:

ERROR 1044 (42000): Access denied for user 'ncadmin'@'localhost' to database 'wordpress'
MariaDB [(none)]> 

Is this the first time you’ve seen this error? (Y/N): Yes

Steps to replicate it:

  1. Issue command mysql -u ncadmin --password=
  2. Issue command create database wordpress;

The output of your Nextcloud log in Admin > Logging:

Can't find Logging on admin page

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'passwordsalt' => '<long string of characters>',
  'secret' => '<long string of characters>',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    5 => 'nextcloudpi.local',
    7 => 'nextcloudpi',
    8 => 'nextcloudpi.lan',
    11 => '<ip-addr>',
    1 => '<aother-ip-addr>',
    3 => '<hostname>',
    2 => 'hostname>',
  ),
  'datadirectory' => '/media/myCloudDrive/ncdata',
  'dbtype' => 'mysql',
  'version' => '20.0.2.2',
  'overwrite.cli.url' => 'https://<ip-address>',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncadmin',
  'dbpassword' => '<long string of characters>',
  'installed' => true,
  'instanceid' => '<string of characters>',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => '<long string of characters>',
  ),
  'tempdirectory' => '/media/myCloudDrive/ncdata/tmp',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'admin',
  'mail_domain' => 'ownyourbits.com',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'overwriteprotocol' => 'https',
  'maintenance' => false,
  'logfile' => '/media/myCloudDrive/ncdata/nextcloud.log',
  'loglevel' => '2',
  'log_type' => 'file',
);

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

To create the NC database, you need root access. Can you log into the RPi by ssh and issue the command:

sudo mysql

than you get logged in to the mysql server as root. If that does not work, you need the mysql root password.

Yes, that worded. Thank you very much. Clearly I now have to assign a password to the root user.

1 Like