[vz-users] dbcopy target port

Daniel Lauckner vz at jahp.de
Sat Sep 9 06:28:08 CEST 2017


Hallo,


am Freitag, 8. September 2017 um 19:07 hat Tino geschrieben:
> I would prefer to run the
> middleware on my Raspi and only move the DB to the NAS.

Worked pretty well over here. I had to change a second time, but it
had nothing to do with the NAS.

> Any suggestions for running the DB on Synology?

I guess the actual "app" thats listening on port 3307 is
MariaDB10? In this case you have to change the port.

1) make sure no older installation of MariaDB is runing. In case
deinstall it first.
2) activate SSH on the NAS, log in as user admin.
3) sudo cp /usr/local/mariadb10/etc/mysql/my.cnf /var/packages/MariaDB10/etc/my.cnf
4) sudo vi /var/packages/MariaDB10/etc/my.cnf
5) change these lines:
   [client]
   port = 3306
   [mysqld]
   port = 3306
(if you are not familiar with vi you should look for a quick overview first)
6) restart the NAS

Now the DB is listening to the needed port. To move the VZ-DB to the NAS:

7) open myphpadmin and log in as user root
8) generate a new database "volkszaehler", make sure the kollation is
set to "latin1_swedish_ci"
9) select the database volkszaehler (left)
10) select privileges (top right)
11) add user
12) name: vz, password: demo, make sure you select "all privilegs on
volkszaehler"
(you may also allow this user only to connect from one host, the Rpi)
13) log in as user pi on your Rpi
14) mysqldump -u root -p volkszaehler >vz.sql
15) the password is "raspberry", the backup will take some time
16) copy the vz.sql from the Rpi to the NAS, i.e. with Winscp
17) log in as user admin on the NAS, move to the directory you copied
the vz.sql to
18) /usr/local/mariadb10/bin/mysql -u vz -p volkszaehler <vz.sql
19) password: "demo", this will take even longer than the backup
20) sudo cp /var/www/volkszaehler.org/etc/volkszaehler.conf.php
21) change this line:
    $config['db']['host'] = '192.168.9.3';
22) restart Rpi

Now you should be good and running with MW on RPi and DB on NAS.
You may deactivate mysql on the Rpi.


mfg Daniel



More information about the volkszaehler-users mailing list