I followed the instructions to install Nextcloud manually. All worked fine untill the installation wizard. I also tried the command line installation but i get the same error.
Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user āoc_kpwnā@ālocalhostā (using password: YES)
I did make an extra admin user with a normal password for maria db. The user is granted all rights to everything. Logging in to SQL works fine with the Username and password. Yet the nextcloud installation wizards fails. I tried all the solutions (there are all more or less the same, create extra user with admin rights)
The only slightly āunusualā thing about my installation is that my datadir for Mariadb is not in the standard path. But like i said MariaDB itself works.
1 Like
which sql commands did you use to create the user and database?
ācreate databaseā for the database
CREATE USER āsqladminā@ālocalhostā IDENTIFIED BY āpassā;
GRANT ALL PRIVILEGES ON . TO āsqladminā@ālocalhostā WITH GRANT OPTION;
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES on nextcloud.* to 'username'@'localhost';
FLUSH privileges;
https://docs.nextcloud.com/server/17/admin_manual/configuration_database/linux_database_configuration.html#configuring-a-mysql-or-mariadb-database
I tried it, same result.
Error message:
Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user āsqladminā@ālocalhostā (using password: YES)
which command did you use here? (occ ā¦)
sudo -u www-data php occ maintenance:install --database āmysqlā --database-name ānextcloudā --database-host ālocalhostā --database-port ā3306ā --database-user āsqladminā --database-pass " **** " --admin-user āadminā --admin-pass " **** "
of course * is just to hide the passwords.
just a guess: try without --database-port ā3306ā
I akready tried ommitting that field. No difference
but you are able to connect via mysql command?
Des thats works just fine. As the new user and as root.
last idea: funny charaters in the password?
you could try the php code on this page:
https://www.w3schools.com/php/php_mysql_connect.asp
1 Like
Good guess! That was a problem before but i solved that quickly. The passwords now are long, but only contain upper and lowercase letters. I will check the site.
I tried the php code on that page to use PDO to connect to my mariaDB it works just fine.
I also verified the downloaded nextcloud files. They are ok too. Maybe a useful error message would help, but as usual that is too much to ask for.
apache is also serving other pages which all workā¦
according to nextcloud.log there is either a wrong password or an sql syntax error. The password is correct since i copied it.
Anyone knows where the php script sits that is executed during installation?
Exactly, thank you!After removing the backslash charakter, it worked perfectly!