DB Password changing


I want to change the DB Password in mysql for the NC DB.
How can I do that and in which configs I must change the parameters?

NC give’s a own DB PW and User after the first install…

1 Like

You can try mysql -u root -p

ALTER USER 'user'@'hostname' IDENTIFIED BY 'newPass';

but that’s just guessing as I know nothing about your setup

it’s just in the config/config.php file on Nextcloud side.

Ok, the password in the config.php is crypted. How can I make a cryption of my new DB Password to write it in the config?

I there Problem to give the root User of mysql a Password?
How can I change the DB Password for the user ncp in the database?

Oh, is that new? Mine is still unencrypted (NC 18) …

1 Like

Unencrypted on my NC19…


Your password cannot be encrypted unless you added custom source code!.

Yes it is okay to have a password for the root user.

No We do not use root for normal usage!

Did you setup mysql_secure_installation

change the password for user ncp by connecting to the mysql database as root to administrate the user.

mysql -u root -p

will connect to mysql as -u defines user root and -p requires you to enter the root password.

use mysql;

now use database mysql where the users are stored.


Where ncp is the username
where hostname should be localhost which is enough or % to have access from any ip.
and where NEW_PASS equals your new non encrypted password.

1 Like