Changing SQL DB password?


What is the correct way to change the SQL database password? I had to switch hosts and I got new user/password for my MariaDB. I tried to add user and password to the config.php and then do a php occ maintenance:repair - is this the way to do it?

Haven’t found an answer nowhere…


If the content of the database was copied unchanged to the new host, it is sufficient to set the new user/pass in config.php. With respect to the database you don’t need to do anything else.

Other things will have to be checked when migrating (data directory, ssl certs, trusted domains, …)


sadly this doesn’t work and I get “Internal Server Error”

Could you describe in detail what steps you took before encountering the problem? Does switching hosts mean you did a full data/db migration to another machine?

yes, I did a full data/db migration. Then changed the config.php with the new user/pw and then tried the php occ maintenance:repair command. Nothing else so far.

Please post the error(s) from the nextcloud log. You can find the file nextcloud.log in your data directory.

Some more infos to your setup are needed:

  • How did you copy the nexctloud and data files?
  • Are permissions/owner/group the same as before?
  • The data path has been adjusted in config.php or is it the same on the new machine?
  • Do you use another domain name?
  • What kind of database do you use. Which version was installed on the old machine, which on the new one?
1 Like

Thank you for your patience or rather very good questions. It lead me to the solution. Which was in my case: the wrong directory I was working in… so the edits in my config didn’t have any effect.

1 Like