Using MySQL Workbench

Download MySQL workbench from the Oracle website

(version 8.0.0.22 and 23 currently don’t work on MacOS select go here for selecting version)

  • Click on the plus symbol, next to MySQL Connection.
    • Enter a name for your connection
    • Enter the hostname: kalahariresearch.org
    • Enter your username
    • Click Test connection and enter your password provided
  • The connection will be saved and you can use the database schemas you have been provided with.

Using R

Initiating MySQL server connection

install.packages("RMariaDB") 				# Install the package
library(RMariaDB)   					# Open library
krtdb <- dbConnect(MariaDB(), 				# Create connection to database
	user = ‘yourdistributedusername',		# Login details be distributed on request
	password = 'distributed2you', 
	dbname = ‘Meerkatdatabase’, 
	host = ‘databases.kalahariresearch.org')

Fetching data into dataset

dbListTables(mydb)					# Lists available tables
dbListFields(mydb, 'table_name') 			# Lists available fields in selected Table

qrydata <- dbSendQuery(krtdb, "SELECT * FROM Meerkatdatabase ") 
	# Runs Query on remote server
gps_data <- fetch(qrydata, n = -1)                       	# Fetches results and saves as dataset
	# n = -1 fetches all records queried