ONLYOFFICE / docker-onlyoffice-nextcloud

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mysql setup guide

Zingerpost opened this issue · comments

After installing and running the docker-compose up -d command, you must create a database according to the instructions:

If you want to use MariaDB with NextCloud, then you will need to run a MariaDB Docker container. Replace your-pass with your preferred MariaDB root password.

sudo docker run --restart=always --net docker-onlyoffice-nextcloud_default --name mariadb-server -e MYSQL_ROOT_PASSWORD=your-pass -d mariadb --log-bin --binlog-format=MIXED

Check status.
sudo docker ps

Once MariaDB container is running, we can access it by issuing the following command.
sudo docker exec -it mariadb-server bash

Then log into MariaDB server as root.
mysql -u root -p

Then create a database for Nextcloud. This tutorial name the database nextcloud. You can use whatever name you like.
create database nextcloud;

Create the database user. Again, you can use your preferred name for this user. Replace your-password with your preferred password. Notice that we want to create an user which would be able to login from NextCloud container, which has the IP address 172.18.0.3.
create user nextclouduser@172.18.0.3 identified by 'your-password';

Note: Your NextCloud container may have a different IP address. Run the following command on the host to find it.

sudo docker inspect app-server | grep IPAddress

Grant this user all privileges on the nextcloud database.
grant all privileges on nextcloud.* to nextclouduser@172.18.0.3 identified by 'your-password';

Flush privileges and exit.
flush privileges;

exit;

Exit out of MariaDB container.
exit

Now in the NextCloud install wizard, you can create an admin account and enter the details of MariaDB database server. Note that you need to replace localhost with mariadb-server, which is the name of MariaDB container. localhost here points to NextCloud container. Because NextCloud container and MariaDB container are both in the onlyoffice network, NextCloud can resolve mariadb-server using an embedded DNS server.

Using a Script to Integrate OnlyOffice and NextCloud

cd docker-onlyoffice-nextcloud
sudo bash set_configuration.sh

The instructions are written in the issues section so that users can immediately find a solution to the problem. Sorry