There is 1 comment.
 
 
XWiki Docker images / cid:jira-generated-image-avatar-6f25c422-9a6f-4f5c-8a09-a8a2cfa32b18 XDOCKER-73 Closed

Access denied when creating subwikis

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-dd3a27b8-7dcf-41d5-8c35-a9e6610a4ea9 Vincent Massol on 19/Jul/26 09:51
 
This is resolved by the {{init.sql}} mechanism introduced in XDOCKER-118.

On MySQL/MariaDB each subwiki lives in its own database, and the {{xwiki}} DB user originally lacked the privilege to create one, hence {{Access denied for user 'xwiki'@'%' to database '<wiki>'}}. XDOCKER-118 added an {{init.sql}}
({{grant all privileges on *.* to xwiki@'%'}}) , mounted at {{/docker-entrypoint-initdb.d/init.sql}} , which and executed by the MySQL/MariaDB official images execute on first database initialization, giving containing:
{noformat}
grant all privileges on *.* to xwiki@'%'
{noformat}
This gives
the {{xwiki}} user the privileges needed to create subwiki databases. (Postgres is unaffected: subwikis there use schemas within a single database.)

Note: the grant only applies to freshly initialized DB volumes, since {{/docker-entrypoint-initdb.d}} scripts run only on first init. Pre-existing volumes need the manual GRANT.

Closing as a duplicate of XDOCKER-118.