0

I'm trying to connect to and run queries on two large, locally-stored SQL databases with file extensions like so:

filename.sql.zstd.part
filename2.sql.zstd

My preference is to use the RMySQL package- however i am finding it hard to find documentation of a) how to access locally stored SQL files, and b) how to deal with the zstd extension.

This may be very basic but help is appreciated!

human12
  • 13
  • 5
  • It seems like you have the SQL code to generate the tables and data within a DBMS, but don't have a DBMS instance somewhere to work with. Depending on your OS and computer "strength" (e.g., ram, hdd), I generally recommend using a docker instance for quick database work. Since you say you want to use the `RMySQL`, that would suggest you could start a local [`mysql`](https://hub.docker.com/_/mysql) docker container. This may be a steep learning curve for you if you have never used docker or command-line SQL before, but it's worth it in the long run. Good luck! – r2evans Mar 05 '21 at 14:39

1 Answers1

0

Seems like you have problems understanding the file extensions.

filename.sql.zstd.part

.part usually means you are downloading a file from the internet, but the download isn't complete yet (so downloads that are in progress or have been stopped)

So to get from filename.sql.zstd.part to filename.sql.zstd you need to complete your download

.zstd means it is a compressed file (to save disk space). You need a decompression program to get from filename.sql.zstd to filename.sql

The compression algorithm used is called Zstandard so you need a decompressor specifically for this program. Look here https://facebook.github.io/zstd/ for such a program. There was also once an R package for this - but it has been archived. But you could also download an older version (https://cran.r-project.org/web/packages/zstdr/index.html)

In filename.sql is actually not a database. In an .sql file are usually SQL statements for creating / modifying database structures. You'd have to install a database e.g. MariaDB and then import this .sql file to actually really have the files in a database on your computer. And then you would access this database via R.

Steffen Moritz
  • 7,277
  • 11
  • 36
  • 55