Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I configure RMariaDb on a work device? #293

Open
lbui30 opened this issue Nov 28, 2022 · 2 comments
Open

How can I configure RMariaDb on a work device? #293

lbui30 opened this issue Nov 28, 2022 · 2 comments

Comments

@lbui30
Copy link

lbui30 commented Nov 28, 2022

I cannot figure out how to properly set up RMariaDb. I tried the .my.cnf file but it didn't really work in the default folder, because of organizational restrictions on which folders have read/write permissions.

Is there a way I can simply pass the information to MariaDb as username and password from a .yml file? Or a way to pass in the location of the .my.cnf that is not in a default location?

I have started with the former option, but I have not had much luck.

# My SQL Config
# Anonymized username and password for reprex
mysql:
  driver: "MySQL ODBC 8.0 ANSI Driver"
  server: "localhost"
  database: "database"
  username: "username"
  password: "password"
#Anonymized folder location for reprex
myconfig = config::get(config = "mysql",file = "C:/lbui/secretfolder/ofsecrets/config.yml")
con <- DBI::dbConnect(RMariaDB::MariaDB(),
                      Server   = myconfig$server,
                      dbname   = myconfig$database,
                      UID      = myconfig$user,
                      PWD      = myconfig$password,
                      Port     = 3306)
@krlmlr
Copy link
Member

krlmlr commented Nov 28, 2022

Thanks.

https://dbi.r-dbi.org/reference/dbconnect shows all implementations of dbConnect(), also the one for RMariaDB.

https://rmariadb.r-dbi.org/reference/dbconnect-mariadbdriver-method suggests that the arguments are username and password, not UID and PWD .

Should those common alternative spellings, e.g., user, uid, UID or passwd and password, work by default?

@kwakuduahc1
Copy link

Would you consider using the .my.cnf option? It is the safest in my opinion and there is 0 chance of credentials being exposed, if I understand the docs right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants