Permission denied for user error while creating sub wiki

I am getting this error : Access denied for user ‘xwiki’@’%’ to database ‘demo’
even if I have granted permission in init.sql ‘grant all privileges on . to ‘xwiki’@’%’;

Hi, Suraj. You need to tell us what you’re doing with your init.sql file. Are you sure you executed it in your DB? How are you setting-up XWiki?