Access Database config.php

Hey guys, I’m new to the forum.

I installed Nexcloud and now I want access to my database.

I’ve been researching and found access in the config.php file.

But how do I access this database on localhost?

It has no address to access the database.

Sorry for the lack of knowledge. I’m studying how Nextcloud works.

I’m already graduated.

Depends?

  • How did you install Nextcloud? Snap, Docker or bare metal?
  • Which DB did you use MariaDB, Postgres or SQlight?

Typically you would need to lookup documentation for your specific database implementation.

I used Snap with mysql version 26.0.4.2

The snap comes with the CLI utilities nextcloud.mysql-client and nextcloud.mysqldump You invoke them like any other cli utility. The mysql-client I believe is just the standard mysql-client so you would interact with it like any other mysql instance.

But where can I view the database port?

In the config.php option I can’t see it.

When I put my IP 192.1.1.1:22 it doesn’t work.

Where is this information?

  1. You shouldn’t need to the nextcloud.mysql-client docs suggest it should be per-configured to connect to the snap’s DB.
  2. Otherwise it’ll be the default mysql port 3306 port 22 is typically ssh.
  3. The snap bound DB wouldn’t be exposed outside the snap container so your 192.1.1.1 wouldn’t work.
  4. you just posted an UN-redacted config.php with your salt, db password and secret key. Whatever you do DO NOT EXPOSE THIS SNAP TO THE INTERNET.