If an administrator wants to create a SQLite3 database using the occ command, all used command line switches should be interpreted correctly.
If an administrator wants to create a SQLite3 database using the occ command, the command line switches --database-name
and --database-table-prefix
are ignored.
> cd nextcloud/
> ./occ --no-ansi status
Nextcloud is not installed - only a limited number of commands are available
- installed: false
- version: 11.0.1.2
- versionstring: 11.0.1
- edition:
> ./occ --no-ansi maintenance:install --database 'sqlite' --database-name 'nextcloud' \
--database-table-prefix 'nc_' --admin-user 'admin' --admin-pass 'pass' \
--data-dir '/var/nextcloud/data'
Nextcloud is not installed - only a limited number of commands are available
creating sqlite db
Nextcloud was successfully installed
owncloud.db
instead of 'nextcloud' :-(> ls -al /var/nextcloud/data/*.db
-rw-r--r-- 1 wwwrun nogroup 589824 Jan 31 19:14 /var/nextcloud/data/owncloud.db
oc_
instead of nc_
:-(> sqlite3 /var/nextcloud/data/owncloud.db .tables
oc_accounts oc_flow_checks
oc_activity oc_flow_operations
oc_activity_mq oc_group_admin
oc_addressbookchanges oc_group_user
oc_addressbooks oc_groups
oc_admin_sections oc_jobs
oc_admin_settings oc_mimetypes
oc_appconfig oc_mounts
oc_authtoken oc_notifications
oc_bruteforce_attempts oc_preferences
oc_calendarchanges oc_privatedata
oc_calendarobjects oc_properties
oc_calendars oc_schedulingobjects
oc_calendarsubscriptions oc_share
oc_cards oc_share_external
oc_cards_properties oc_storages
oc_comments oc_systemtag
oc_comments_read_markers oc_systemtag_group
oc_credentials oc_systemtag_object_mapping
oc_dav_shares oc_trusted_servers
oc_federated_reshares oc_twofactor_backup_codes
oc_file_locks oc_users
oc_filecache oc_vcategory
oc_files_trash oc_vcategory_to_object
dbname
and dbtableprefix
the database and its tables are created as requested. This is an indication that the parameters itself are working but they're not parsed as expexted.<?php
$CONFIG = array (
'dbname' => 'nextcloud',
'dbtableprefix' => 'nc_'
);
OS: Linux 3.2.84
Web server: Apache2 2.4.25
Database: MariaDB 5.5.54
PHP version: 5.6.29
Nextcloud version: 11.0.1
Browser: Mozilla Firefox 51.0.1
Operating system: Windows 7
It seems that issue has still not been fixed in Nextcloud v13.0.6.
When you remove the lines above from sqlite and call
maintenance:install
--database=sqlite
--database-name=nextcloud
--database-table-prefix=nc_
--admin-user=admin
--admin-pass=admin
does it work?
@danielkesselberg Thank you for the hint. If I remove the mentioned two lines of code, the installation works as expected. A database file nextcloud.db
is created and the table prefixes are correctly set to nc_
.
Most helpful comment
https://github.com/nextcloud/server/blob/0211e17e3fe7dd36ba9360de4cc70aaddfafa4c2/lib/private/Setup/Sqlite.php#L32-L33
When you remove the lines above from sqlite and call
does it work?