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

SSL connection to MySQL #341

Open
mingchangtsai opened this issue Jul 26, 2024 · 2 comments
Open

SSL connection to MySQL #341

mingchangtsai opened this issue Jul 26, 2024 · 2 comments

Comments

@mingchangtsai
Copy link

mingchangtsai commented Jul 26, 2024

I am trying to connect to MySQL using RStudio on macbook pro M1 Max running on MacOS Sonoma 14.5

platform aarch64-apple-darwin20
arch aarch64
os darwin20
system aarch64, darwin20
status
major 4
minor 4.0
year 2024
month 04
day 24
svn rev 86474
language R
version.string R version 4.4.0 (2024-04-24)
nickname Puppy Cup

the code that I am using to connect to the database is
con <- dbConnect(
RMariaDB::MariaDB(),
database=‘database_name',
host='database_hostname,
sslmode='REQUIRED',
user = ‘username',
password=‘password'
)

I get the error
Error: Failed to connect: Connections using insecure transport are prohibited while --require_secure_transport=ON.

I checked the connection to database from terminal and I was able to connect without a problem using the command
mysql -h dabase_hostname -u username -p

Since I am able to connect without certification (ca-cert.pem, client-cert.pem, client-key.pem) files, then I don’t think I need to use the arguments in the dbConnect command. However, I tried it and still didn’t work for me.

Looking at RMariaDB documentation, there is no argument for sslmode but in mysql documentation, there is argument for —ssl-mode

any advice would be greatly appreciated.

thank you!

@krlmlr
Copy link
Member

krlmlr commented Aug 1, 2024

Thanks. Can you try

con <- dbConnect(
  RMariaDB::MariaDB(),
  database =database_name',
  host = 'database_hostname,
  user =username',
  password = ‘password'
)

without sslmode='REQUIRED', ?

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

No branches or pull requests

2 participants