IT, 筆記

Access the QNAP (Media and QSync) Database

The previous post mentioned about how to backup the QNAP system or App (e.g. QPhoto) data. During the research, I also find the information about how to access the QPhoto (or QMagik ?) and QSync database.

The database used in QNAP is MariaDB (MySQL). You can try:

ps aux |grep "mysqld "

In my QNAP, I see two instances. Hence, we can use mysql client to connect to it.

Also, we found the data location are the following respectively :

  • /share/CACHEDEV1_DATA/.system/data
  • /share/CACHEDEV1_DATA/.qbox/mysql/data

After several attempts, I found that my QNAP uses Unix socket rather than TCP socket. So, lets use mysql client from terminal directly:

Media DB:

/usr/local/mariadb/bin/mysql -u root -p -S /tmp/mysql_mediadb.sock

# Password is 'qnapqnap'

Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 323074
Server version: 5.5.57-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| file_station       |
| mysql              |
| performance_schema |
| qcoolie_data       |
| s00                |
| s01                |
| test               |
+--------------------+
8 rows in set (0.00 sec)

MariaDB [(none)]>

QSync DB:

/usr/local/mariadb/bin/mysql -u root -p -S /tmp/qsyncsrv/mysql_qbox.sock

# Password is 'qnapqnap'

Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 323074
Server version: 5.5.57-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| qbox               |
| test               |
+--------------------+
5 rows in set (0.00 sec)

MariaDB [(none)]>

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *