title: Cannot set up connection to local database in MonetDB.R
body: <p>The title summarizes my problem, I think. I'd appreciate any pointers anybody might have on what else I could try. I've pasted the console output with comments in bold below. Theinstalled version of MonetDB.R is the latest from R-forge (0.8.5).</p>
  
  <pre><code>fabians@wap27:~$ R
  
  [...]
  
  &gt; library(MonetDB.R)   
  Loading required package: DBI
  Loading required package: digest
  
  Attaching package: ‘MonetDB.R’
  
  The following objects are masked from ‘package:stats’:
  
      sd, var
  
  The following objects are masked from ‘package:base’:
  
      sample, tabulate
  
  &gt; sessionInfo()
  R version 3.0.2 (2013-09-25)
  Platform: x86_64-pc-linux-gnu (64-bit)
  
  locale:
   [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
   [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
   [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
   [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
   [9] LC_ADDRESS=C               LC_TELEPHONE=C            
  [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
  [1] MonetDB.R_0.8.5 digest_0.6.3    DBI_0.2-7      
  &gt; 
  &gt; # as @ https://github.com/ajdamico/usgsd/tree/master/MonetDB:
  &gt; batfile &lt;- monetdb.server.setup(
  +         database.directory = "~/monetdb",
  +         monetdb.program.path = "/usr",
  +         dbname = "test",
  +         dbport = 50000L)
  /home/fabians/monetdb did not exist.  now it does
  </code></pre>
  
  <p>seems to have worked...</p>
  
  <pre><code>&gt;
  &gt; batfile &lt;- "/home/fabians/monetdb/test.sh"
  
  &gt; system(paste("cat ", batfile))
  #!/bin/sh
  /usr/bin/mserver5 --set prefix=/usr --set exec_prefix=/usr --dbpath /home/fabians/monetdb/test --set mapi_port=50000 --daemon yes &gt; /dev/null &amp;
  echo $! &gt; /home/fabians/monetdb/mserver5.started.from.R.pid
  </code></pre>
  
  <p><strong>Can anybody tell me whether that shell script looks like it's supposed to?</strong></p>
  
  <pre><code>&gt; system(paste("ls ~/monetdb"))
  test  test.sh
  </code></pre>
  
  <p>OK, so an (empty) 'test'-directory was created along with the .sh</p>
  
  <pre><code>&gt; monetpid &lt;- monetdb.server.start(batfile)
  Read 1 item
  &gt; system(paste("ls ~/monetdb/test"))
  00e3bc31-ca59-43e6-ace8-a96aac37bddd  bat  box
  </code></pre>
  
  <p>Now after starting the monetdb server the test directory contains the data base info, I guess?</p>
  
  <pre><code>&gt; dbname &lt;- "test"
  &gt; dbport &lt;- 50000L
  &gt; monet.url &lt;- paste0("monetdb://localhost/", dbname)
  &gt; db &lt;- dbConnect( MonetDB.R(), monet.url, 
  +                  port=as.integer(dbport), timeout=as.integer(86400))
  Error in .monetAuthenticate(socket, dbname, user, password) : 
    Authentication error: !monetdbd: no such database 'test', please create it first
  </code></pre>
  
  <p><strong>What could be the reason that the test-directory is not found?</strong></p>
  
  <p>Slightly different command, as in the help for <code>monetdb.server.start</code>and  also at <code>https://github.com/ajdamico/usgsd/tree/master/MonetDB</code>:</p>
  
  <pre><code>&gt; monet.url &lt;- paste0("monetdb://localhost:", dbport, "/", dbname)
  &gt; db &lt;- dbConnect( MonetDB.R(), monet.url, wait = TRUE )
  R: mapi.c:72: mapiConnect: Assertion `Rf_isInteger(port)' failed.
  Aborted
  </code></pre>
  
  <p>This bug is supposed to have been fixed, see <a href="https://stackoverflow.com/q/20783829/295025">here</a> ...</p>