You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensure passwords can be read from options files (#180)
Fixes#166. Wowza what an issue. After spending way too much time
googling various forms of "can't read password from mariadb options
file", I started poking around the capi.jl file, and reading anything
related to "options". I was trying to see if there was a way to have a
debug print of what options were actually read from an options file.
That's when I found the following in the docs for `mysql_real_connect`,
which I'm now very thankful that past me decided to copy/paste all the
api docs for every single api function.
```
For passwd, specify a value of NULL. (For the password, a value of the empty string in the mysql_real_connect() call cannot be overridden in an option file, because the empty string indicates explicitly that the MySQL account must have an empty password.)
```
So if you want a password to be read from an option file, you need to
pass NULL to the `mysql_real_connect` function; but we were always
passing an empty string! So it prevented reading any password from
option files. Anyway, the fix is just that: by default we'll pass
`nothing` as the password, which will pass NULL to the actual api call,
allowing passwords to be read from option files.
Copy file name to clipboardexpand all lines: src/api/capi.jl
+2-2
Original file line number
Diff line number
Diff line change
@@ -1129,8 +1129,8 @@ If no value is found in an option file for a parameter, its default value is use
1129
1129
Return Values
1130
1130
A MYSQL* connection handler if the connection was successful, NULL if the connection was unsuccessful. For a successful connection, the return value is the same as the value of the first parameter.
0 commit comments