Nextcloud out after install screen

Good morning,
I have made an install of Nextcloud on DO with mariadb and nginx. I’m accessing it straight from the IP (no domain name) and I have not encryted anything. Nextcloud has been installed into /var/www/nextcloud. It is a fresh install with the db called ‘nextcloud’ and a mysql user ‘nextcloud’.

I got everything working up to the first initial blue screen when we have to create the admin account.
Now the original address 139.xx.xx.xx is refering to http://139.xx.xx.xx/index.php/apps/files/ and I got the
404 Not Found
nginx/1.10.0 (Ubuntu)

php is working (139.xx.xx.xx/info.php is working), nginx is also working (i have pages displaying on other ports (139.xx.xx.xx:3838)

Here is what the nextcloud.log is saying:

{“reqId”:“BooqU5vXzjWF669u1HwZ”,“remoteAddr”:“”,“app”:“mysql.setup”,“message”:“Specific user creation failed: An exception occurred while executing ‘SELECT user FROM mysql.user WHERE user=?’ with params [“oc_admin”]:\n\nSQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user ‘nextcloud’@‘localhost’ for table ‘user’”,“level”:3,“time”:“2016-12-09T07:23:26+00:00”,“method”:“POST”,“url”:"/index.php",“user”:"–"}
{“reqId”:“BooqU5vXzjWF669u1HwZ”,“remoteAddr”:“”,“app”:“mysql.setup”,“message”:“Database creation failed: An exception occurred while executing ‘GRANT ALL PRIVILEGES ON nextcloud . * TO ‘nextcloud’’:\n\nSQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user ‘nextcloud’@‘localhost’ to database ‘nextcloud’”,“level”:3,“time”:“2016-12-09T07:23:26+00:00”,“method”:“POST”,“url”:"/index.php",“user”:"–"}

So I know I have an issue with mysql rights, etc. But how can I fix it?

Thanks in advance for hints and/or advices


Did you create a database before installing Nextcloud?

Hi @Sanook,
Thanks for you reply.

Here are the operations I made
curl -LO
sudo tar -C /var/www -xvjf nextcloud-10.0.1.tar.bz2
Run the bash script from here


printf "Creating possible missing Directories\n"
mkdir -p $ocpath/data
mkdir -p $ocpath/assets
mkdir -p $ocpath/updater

printf "chmod Files and Directories\n"
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750
chmod 755 ${ocpath}

printf "chown Directories\n"
chown -R ${rootuser}:${htgroup} ${ocpath}/
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
chown -R ${htuser}:${htgroup} ${ocpath}/assets/
chown -R ${htuser}:${htgroup} ${ocpath}/config/
chown -R ${htuser}:${htgroup} ${ocpath}/data/
chown -R ${htuser}:${htgroup} ${ocpath}/themes/
chown -R ${htuser}:${htgroup} ${ocpath}/updater/

chmod +x ${ocpath}/occ

printf "chmod/chown .htaccess\n"
if [ -f ${ocpath}/.htaccess ]
chmod 0644 ${ocpath}/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
if [ -f ${ocpath}/data/.htaccess ]
chmod 0644 ${ocpath}/data/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess

Then edit the /etc/nginx/site-availabe/default to allow the PHP
Then reload: sudo systemctl reload nginx

Then create the database, user and grant privilege to user
mysql -u root -p
GRANT ALL ON nextcloud.* to ‘nextcloud’@‘localhost’ IDENTIFIED BY ‘set_database_password’;

Hi @Sanook,
Yes I did,

MariaDB [(none)]> show databases;
| Database |
| information_schema |
| mysql |
| nextcloud |
| performance_schema |
4 rows in set (0.00 sec)

MariaDB [(none)]> SELECT User FROM mysql.user;
| User |
| flipo_nc |
| nextcloud |
| root |
3 rows in set (0.00 sec)

This looks like you have entered the incorrect password for the database at the initial blue screen

In this case your password would be set_database_password.

Can you login to mysql with

mysql -u nextcloud -pset_database_password
show databases;