SQL Hosted on Synology NAS

54 views
Skip to first unread message

Mike P

unread,
Jul 24, 2019, 12:28:06 PM7/24/19
to weewx-user
Hello everyone,

I tried searching and using the guide but I am struggling to get this to work. My knowledge of this is pretty limited so please bear with me.

I am trying to have the weewx use the mysql db (specifically MariaDB 10) on my NAS. I created the DB called weewx in phpMyAdmin and created a user account of weewx password weewx as recommend in the guide. I changed the config file to address weewx as the DB and changed the address of the DB to my internatl address, in this case 192.168.1.90:3307. It doesn't look like anything is feeding into the DB though.

Anything I did glaringly wrong or any assistance you can provide would be helpful.

Thanks,
Mike

gjr80

unread,
Jul 24, 2019, 2:04:00 PM7/24/19
to weewx-user
Hi,

Perhaps the log might have some clues? Try setting debug = 1 in weewx.conf then restart WeeWX. Let WeeWX run for a couple of archive periods then post the log from WeeWX startup. Make sure you post all of the startup sequence (please don’t post just part, the startup log provides important config info).

Gary

MikeQ

unread,
Jul 25, 2019, 1:58:51 PM7/25/19
to weewx-user
The Synology does not have any remote user accounts enabled by default.  I assume you are running phpMyAdmin on the Synology.  Did you login to the Synology using SSH and create a remote account?

You can check if you have a remote account configured by doing this:

1.  Verify you have SSH enabled on the Synology using Control Panel | Terminal & SNMP | Enable SSH service
2.  Connect to the Synology using SSH. Login with admin and your admin password
3.  Change to the directory: /volume1/@appstore/MariaDB/usr/bin
4.  Run the command ./mysql -u root -p and enter your MariaDB root password when prompted
5.  Run this mysql command which will list your users:  SELECT User, Host FROM mysql.user;
6.  You must have at least one user who is allowed to connect remotely and that user must be used in the WeeWX config.  In the info below, 'sai...@192.168.71.6' is my remote account that is allowed to connect remotely.  I actually have phpMyAdmin on a Linux Server and use that install to manage MariaDB on my Synology using this remote account:

Also, I think the Synology MariaDB listens on port 3306 by default for remote connections, but you have :3307 listed above.  You can check your Synology by going to the Main Menu and clicking on MariaDB 5 .
+---------+---------------------+
| User    | Host         |
+---------+---------------------+
| root    | 127.0.0.1      |
| saimail  | 192.168.71.6  |
| root    | ::1           |
|        | localhost     |
| php4dvd | localhost     |
| root    | localhost     |
|        | synology-216  |
| root    | synology-216  |
+---------+--------------------+
8 rows in set (0.06 sec)

MikeQ

unread,
Jul 25, 2019, 2:16:54 PM7/25/19
to weewx-user
In your original post, I missed you are using MariaDB 10 so the default port for it is 3307 instead of 3306 used by Maria DB 5.

I also should have mentioned a way to test your connection from remote.  Are you running WeeWX on a Raspberry PI?  If so, you can install just the MariaDB client using: sudo apt-get install mariadb-client-10.1

Once the client is installed, you can run this command to test your connection to the Synology (my Synology is at 192.168.71.4):

$ mysql -usaimail -p -h 192.168.71.4
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.5.62-MariaDB Source distribution

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Reply all
Reply to author
Forward
0 new messages