# RPresto: unable to connect to Starburst Galaxy

**URL:** <https://www.starburst.io/community/forum/t/rpresto-unable-to-connect-to-starburst-galaxy/600>\
**Category:** Starburst Galaxy\
**Created:** [November 3, 2024, 5:20pm UTC](https://www.starburst.io/community/forum/t/rpresto-unable-to-connect-to-starburst-galaxy/600 "2024-11-03T17:20:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rparrish](https://www.starburst.io/community/forum/user_avatar/www.starburst.io/rparrish/32/263_2.png) [@rparrish](https://www.starburst.io/community/forum/u/rparrish)\
**Post date:** [November 3, 2024, 5:20pm UTC](https://www.starburst.io/community/forum/t/rpresto-unable-to-connect-to-starburst-galaxy/600/1 "2024-11-03T17:20:57Z")

</div>

Using RPresto 1.4.6 on R 4.4.1, I’m getting a 401 authentication error using this snippet to connect to a Free Cluster:

```auto
con <- DBI::dbConnect(
    drv = RPresto::Presto(),
    host = Sys.getenv("TRINO_HOST"),
    port = 443,
    user = Sys.getenv("TRINO_USER"),
    password = Sys.getenv("TRINO_PASSWORD"),
    catalog = "sample",
    schema = "demo")

```

I’m able to successfully connect via Trino CLI using the same environment variables and from DBeaverCE.

Any suggestions or alternative ways to connect to Starburst Galaxy from R would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![rparrish](https://www.starburst.io/community/forum/user_avatar/www.starburst.io/rparrish/32/263_2.png) [@rparrish](https://www.starburst.io/community/forum/u/rparrish)\
**Post date:** [November 11, 2024, 4:17pm UTC](https://www.starburst.io/community/forum/t/rpresto-unable-to-connect-to-starburst-galaxy/600/2 "2024-11-11T16:17:34Z")

</div>

Just in case others come across this thread, here’s a solution that works:

> <https://github.com/prestodb/RPresto/issues/273#issuecomment-2465650800>
>
> Using RPresto 1.4.6 on R 4.4.1, I’m getting a 401 authentication error using thi…s snippet to connect to a Free Cluster on Starburst Galaxy:
> 
> \`\`\`
> con \<- DBI::dbConnect(
> drv = RPresto::Presto(),
> host = Sys.getenv("TRINO\_HOST"),
> port = 443,
> user = Sys.getenv("TRINO\_USER"),
> password = Sys.getenv("TRINO\_PASSWORD"),
> catalog = "sample",
> schema = "demo")
> \`\`\`
> 
> I’m able to successfully connect via Trino CLI using the same environment variables and from DBeaverCE.
> 
> Any suggestions or alternative ways to connect to Starburst Galaxy from R would be greatly appreciated
