I'm trying to use an SQL database on Shiny-Server for the first time. Shiny-Server and the database (MariaDB) are running on the same Amazon Lightsail LInux instance. I can see the database remotely using HeidiSQL, so I'm convinced it's up and running. The program crashes at the first place it tries to access the database. (The code runs fine locally on Win7 with a local MySQL database).
Here's the code in that area:
root.pool <- dbPool(
drv = RMariaDB::MariaDB(),
host = "localhost",
user = "root",
password = SQL.Passwords[1]
)
zzz = onStop(function() { poolClose(root.pool) } )
print("Getting SQL.DBs...")
SQL.DBs <- dbGetQuery(root.pool, "SHOW DATABASES")
print(SQL.DBs)
The print("Getting SQL.DBs...") appears in the log and the following print() doesn't, so I think this is where the program stops. That would make sense anyhow, since it's the first spot I use a DBI function.Here's the error log:
[1] "Getting SQL.DBs..."
Warning: Error in result_fetch: Error fetching buffer:
Stack trace (innermost first):
56: <Anonymous>
55: stop
54: result_fetch
53: sqlColumnToRownames
52: .local
51: dbFetch
50: dbFetch
49: .local
48: DBI::dbGetQuery
47: DBI::dbGetQuery
46: dbGetQuery
45: dbGetQuery
44: eval
43: eval
42: withVisible
41: source
1: runApp
Error : Error fetching buffer:
Does anyone have any thoughts on what I need to do next?