Database errors on first setup

Need an answer as to why this happens and how to fix it…

Have you tried deleting entire Database and start again?

Check the permissions in the creation of database:

CREATE DATABASE nextcloudDB CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'nextcloud1'@'localhost' IDENTIFIED BY 'password1';
GRANT ALL PRIVILEGES ON nextcloudDB.* TO 'nextcloud1'@'localhost';
FLUSH PRIVILEGES;
exit;

In Nextcloud config.php check this:

  'dbtype' => 'mysql',
  'version' => '20.0.4.0',
  'dbname' => 'nextcloudDB',
  'dbhost' => 'localhost:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud1',
  'dbpassword' => 'password1',

I deleted the database and started over three times in a row…

Thanks, that did not help, despite creating the database . It still only creates the oc_migrations table…

An exception occurred while executing ‘SELECT uid, displayname FROM oc_users WHERE uid_lower = ?’ with params [“nextcloud”]: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘nextclouddb.oc_users’ doesn’t exist

I could try creating and populating the database manually and then skip the setup… its a thing I have done many times when moving sites, albeit not with Nextcloud. What file has the DB entries…?

Are you using web based installer or OOC command?

I use OOC when I setup a new instance, this is an example with data of last post

sudo -u www-data php /var/www/nextcloud/occ maintenance:install --database “mysql” --database-name “nextcloudDB” --database-host=“192.168.1.62:3306” --database-user “nextcloud1” --database-pass “password1” --admin-user “castillo92” --admin-pass “adminPSW” --data-dir "/mnt/HDD1/NC_data"

After that I finish the config sudo nano /var/www/nextcloud/config/config.php and finally enter the web-UI

I think you may need to reread my first post?

hello,I also encounter this problem,I have tried many kinds of methods and just cant resolve it

Still an issue I am unable to get around.

Again, running Xampp LAMP on Windows Server with Apache and PHP working fine for other things.
NOT using IIS. Not even installed, dual Xeon 12 cores and 144GB DDR3 RAM.

I have never seen this error, but when I see odd errors I have found they can trace back to something else. Such as:

It’s not caused by a persmission issue is it? Have you given rights to apache? (chown -R www-data:www-data /var/www/)?

Good luck!

Andrew

I dont see how that can affect wrong and lacking input to the database…

still waiting for a relevant answer… or a further explanation on what to do and why.,

Hi @DevConram ,
i want to be sure , you tried to install nextcloud on a windows server ?
if yes , windows is not supported as operating system :

https://docs.nextcloud.com/server/20/admin_manual/installation/system_requirements.html

Finally a relevant question.

Yes I have read that, I assumed it was referring to using Windos Server IIS as Server. Nothing else.

It is not running on IIS, it is running on xampp with apache/mariadb/php74.

Are you seriously telling me you can’t run Nextcloud on a Windows server even if you use the same LAMP or LEMP configuration you would use on Linux or in a VM/Docker/K8 ?

Why?

@DevConram
after some research, I saw that people using windows server goes through a VM of Linux to use nextcloud.

Not interested in doing it that way since it adds an additonal hurdle in regards to system file access in Windows. Linix is crappy, been at it, there are like 25 different ways to do things, there are hardly any standards and I am fed yup with trying 5 different distros that all have a sligthly different approach in how to achive a wanted result. yum, zypper, dnf, bash CRAP

sorry , I can’t help you any further with your problem at the moment.

I share the frustration as the original poster of this issue. I’m trying to get XAMPP/PHP/MySQL working on Windows 10 as well, but running into the same issue. Saying “windows isn’t supported” is garbage as I’m afraid to say the vast majority of OS market share is still Windows users. I unfortunately made the switch to OwnCloud because of this issue.

A better way to approach this issue would be to figure out why oc_users isn’t being created as part of the database creation process, but oc_migrations is. When I look at the nextcloud.log file, I see an error message that says something to the effect of
“Host localhost was not connected because it violates local access rules”, which is odd as the user I created has full privileges, but I assume this same thing happens if using the default root user as well.

My advice to the developers, download the 3 latest stable versions of NextCloud, the 3 latest versions of PHP, and the 3 latest versions of XAMPP onto a Windows 10 machine, and try to set up a server using XAMPP’s PHP and MySQL data. A tip, drag and drop the 3 NextCloud folders into the xampp/htdocs folder and call them nextcloud1, nextcloud2, nextcloud3 to make them easier to navigate to. This shouldn’t be too hard to diagnose for the developers who know where to look at the logs, etc. But if at the end of the day it just plain old doesn’t work cuz windows, switch to OwnCloud.

That may be true for the desktop market. On the server market it looks quite different. Depending on which statistics you look at, the market share of Windows on servers is well below 50%. And for web services that run on a LAMP or LEMP stack, it’s probably way less.

OwnCloud doesn’t officially support Windows either.

https://doc.owncloud.com/server/10.9/admin_manual/installation/system_requirements.html

Matter of fact the only thing about Windows I could find on their web-site is this…

https://owncloud.com/de/news/owncloud-server-8-1-will-not-support-windows-as-server-platform-natively/

It’s from 2015 but I couldn’t find anything on the website that says this has changed in the meantime. The official solution to run it on Windows at that time was to use a VirtualBox VM with Linux. Today you could also use WSL2, which is basically a Linux VM too.

https://www.qoncious.com/questions/test-owncloud-server-localhost-using-xampp-or-wamp

Worked for me, so I’m happy, basically doing the exact same setup routine, so something’s not working on the NextCloud side. Hope Windows sees some support soon as I’ve seen quite a few posts re: this issue.

Yeah but if it isn’t officialy supported it can also break at any time. I hope you are using this set-up only for personal use and not in production for a company or even worse, offer it as a solution to small businesses who don’t know they are paying you for an unsupported solution.

Personal use.