Database¶
Some quick notes for MariaDB on the QNAP. Meant to be direct port of MySQL (but both are open-source…?)
Dump of everything I was working on today and yesterday. Still trying to figure out how to do RESTful APIs.
Setting up
- Search for the binary using
find / -name mysql - QNAP has aliases for the same directory:
/usr/local/mysqland/usr/local/mariadb - Connect to the database using
/usr/local/mariadb/bin/mysql -u root -p
MariaDB
- root/admin default password
- QNAP-specific: https://forum.qnap.com/viewtopic.php?t=138714
- phpMyAdmin gives direct access to database: https://pyuxiang.com/phpMyAdmin
- Good tutorial and background on databases: https://mariadb.com/kb/en/database-design-phase-2-conceptual-design/
- Essentially data structure choice for indices: https://www.sqlshack.com/what-is-the-difference-between-clustered-and-non-clustered-indexes-in-sql-server/
SQL server
- Do not expose SQL server to web: reddit, sqlserverscience, so
- Standard practice to use SSH or VPN as gateway
- Equifax breach: https://www.csoonline.com/article/3444488/equifax-data-breach-faq-what-happened-who-was-affected-what-was-the-impact.html
Sending and processing POST requests
mod_pythonis inactive, whilemod_wsgiis currently uncompilable on the QNAP. Need to look for alternative scripting languages.- PHP seems appropriate: insert into SQL
- HTML5 form examples: one, two, three
LAMP looks like the minimalist way to go.
Graph plotting
- Can’t seem to build matplotlib in the QNAP, resorting to GNUplot for server-side plotting of the gym graphs.
- GNUplot: Basic setup
- GNUplot: Multicolor
- GNUplot: Multiple graphs
- gplot.py: Standalone Python interface for GNUplot