Can't finish installation of NC12

installing nextcloud 12I received the following error message on the last page of the wizard::

Error while trying to create admin user:
Failed to connect to database An exception occurred in the driver
ERROR [HY000] [1698] Access denied for user ‘root’@‘localhost’ !

I found out that the password for the NEXTCLOUD Admin (pw1) will be superseded with the SQL Password (pw2).

Very strange, that these passwords will be mixed up!

Very, very strange!

Did you follow the admin manual on how to configure mysql? https://docs.nextcloud.com/server/12/admin_manual/configuration_database/linux_database_configuration.html#configuring-a-mysql-or-mariadb-database

For database access Nextcloud should use an own user instead of root.

Thanks for your refernce!

What is the PDB:mysql extension inPHP ?
apt-cache search pdo_mysql Did not give any reference or result!
regards, hitam

The mysql PHP package is called php-mysql or php7.0-mysql, it includes the pdo-mysql PHP module.

Thanks, both packages have been installed!

Still no access possible…the worst piece of software i ever used before…

You must use non-root mysql user for Nextcloud. Try this commands with mysql command line:

create database nextclddb;
create user ‘nextcloud’ identified by ‘fkxvnds123rwer’;
grant all on nextclddb.* to ‘nextcloud’ identified by ‘fkxvnds123rwer’;
flush privileges;

(In this case “nextclddb” is your mysql database for nextcloud use, “nextcloud” is mysql user of this database, and “fkxvnds123rwer” is password of this user).

PS: in some mysql realisations (ie percona etc) password must be strong.

How to start mysql command line ?

i tried to to resolve the problem with

mysqld_safe --init-file=mysql-init &

init-file containing: ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘password’;

However, ALTER USER is defined in mariadb 10.2 and I am using 10.1.

The person involved did not get a satisfying answer and I am still stuck !
Please help !

regards, hitam

I just deleted everything and finished with Nextcloud for good!

No need to answer anymore!

mysql -u root
You’ll be prompted for root’s password.

Thanks for your answer!

etc/mysql/conf.d >mysql -u root
ERROR 1698 (28000): Access denied for user ‘root’@‘localhost’

That is the result of : mysql -u root !!

I tried to set the password :
/usr/sbin/mysqld --init-file=/etc/mysql/conf.d/mysql-init

mysql-init contains: SET PASSWORD FOR ‘root’@‘localhost’ = PASSWORD(‘rootpassword’);

Result: ACCESS denied !!

Any idea ???

On another website i found a detailed step by step guidance to reet the root password:

https://www.fossgeek.org/server-configuration/reset-mysql-root-password/
Which helped me a lot to cahne the password.

However :
mysql -u root
ERROR 2003 (HY000): Can’t connect to MySQL server on ‘127.0.0.1’ (111 “Connection refused”)

What went wrong ?
regards, hitam

If you have problems with your database when connecting via terminal and resetting passwords, this is clearly not an issue of Nextcloud and people here are not the best skilled on debian-related upgrade issues. In your place, I would try the debian community and try to make work my webserver with php and *sql first (phpmyadmin should run properly).

Try this commands for root password reset:

sudo service mysql stop
sudo mysqld_safe --skip-grant-tables --skip-syslog --skip-networking
mysql -u root

You’ll see a mysql command prompt. Now try this (change password (not PASSWORD) to needed root’s password :slight_smile: ):

UPDATE mysql.user SET Password=PASSWORD(‘password’) WHERE User=‘root’;
FLUSH PRIVILEGES;
exit;

You’ll returned to system command shell. Now try this:
mysqladmin shutdown
sudo service mysql start

Now login into mysql command line normally (using new root’s password) and you can create needed for NC database etc.

The .occ command are broken in stable 12 and reported here: https://github.com/nextcloud/server/issues/5049

1 Like