Following the principle that “it’s not yours unless it’s on your own hard drive,” and with my phone’s growing image collection desperately needing an offload to save storage, I decided to download and organize artworks by artist. I needed a way to record progress and query/update data quickly. I originally used a Markdown list, but as the artist count grew, searching became way too slow.
Two days later, it clicked: for “logging” stuff, a database is obviously the best tool for the job!
Download and Installation
I decided to go with MySQL. For installation, you can refer to guides like MySQL Download and Installation - Zhihu . Some details might have changed, but the process is largely the same.
I just went with the default installation—clicking “Next” until it was done (too lazy to customize).
To start the service, hit Win+R, type services.msc, find the MySQL service, and start it.
Database Design
To be honest, there’s not much to “design” here. I mainly download from Pixiv and some from Twitter, so a single table is enough.
| ID | name | downloadDate | lastDownloadID | platform | url |
|---|---|---|---|---|---|
| Unique Artist ID | Name | Download Date | Last Downloaded Artwork ID | Platform | URL |
Which normal form is this? Who cares. Here is the code:
| |
Downloading Artworks
- Pixiv
I use the “Powerful Pixiv Downloader” extension. Chrome Web Store Link
GitHub: xuejianxianzun/PixivBatchDownloader
Note: Enable slow crawling. Downloading too fast or too much at once will result in a temporary IP ban.
I use the “Twitter Media Downloader” extension. Chrome Web Store Link
Official site: Twitter Media Downloader - furyu
Data Insertion
| |
For multiple rows, just separate them with a comma ,.
Updating Data
| |
Learn more: Database Learning Part 3: SQL Language – yexca’s Blog
MySQL Service Missing?
Here is a quick fix for a problem I encountered. When I tried to open the database to import data, I found that the MySQL service was missing from my Windows Services list.
Run CMD as Administrator and navigate to the MySQL/bin directory:
| |
It should be up and running in a few seconds, and no data was lost.
New to Databases?
My intro: Database Learning Part 1: Intro to Databases – yexca’s Blog
Runoob: SQL Tutorial - Runoob
Reference Articles
Common MySQL Table Options and Constraints - GeaoZhang - Blog Garden