Prerequisites
- some database (here, it's called sakila (mysql standard test db I think))
- a user (with password) that has access to that db (I'll use u:testuser/p:testpass)
Setup - minimal (?) working example
We call
Needs["DatabaseLink`"]
Next we shall use the wizard/connection tool to create a new database connection, like:
c1 = OpenSQLConnection[]

(after creating the new connection, we use the wizard to connect right to the new connection; and obviously, we do not tick the "store password in plain text").
Next, we set up another connection:
c2 = OpenSQLConnection["test"]
where "test" is the name we used for above connection (we get prompted for the password).
Finally, a third connection:
c3 = OpenSQLConnection[
JDBC["MySQL(Connector/J)", "localhost:3306/sakila"],
"Catalog" -> Automatic, "Description" -> None, "Name" -> "test",
"Password" -> "$Prompt", "Properties" -> {}, "ReadOnly" -> False,
"RelativePath" -> False,
"TransactionIsolationLevel" -> "ReadUncommitted",
"UseConnectionPool" -> False, "Username" -> "testuser",
"Version" -> 2.]
(this is exactly copy/paste from the .m file created by the wizard, using OpenSQLConnection instead of SQLConnection. You can check the FullForm of c1 or c2 to find its location, on MacOSX, standard: "/Users/username/Library/Mathematica/DatabaseResources/test.m").
And maybe a last one (choose "test" in the GUI):
c4 = OpenSQLConnection[]
The Problem
Execute:
Cases[#, HoldPattern[Rule["Password", ___]], Infinity] & /@ {c1, c2, c3, c4}
{{"Password" -> "testpass"}, {"Password" -> "\$Prompt"}, {"Password" ->"\$Prompt"}, {"Password" -> "testpass"}}
i.e., c1 and c4 (the connections I opened with OpenSQLConnection[] (without argument)) are sharing my password in plain text!
My Question
Is this a known behaviour? I was using OpenSQLConnection[] (using the GUI) frequently, am I doing something wrong?
Edit See @Murta's answer for an example where the password is visible without using the GUI.
FullForm(evenUncompressed). Can you confirm that this is the case for you too? ... maybe I did something wrong, just want to make sure, and try again – Pinguin Dirk Sep 11 '13 at 08:37c2orc3in my post, and then the password is not visible... (as I don't store those important passwords, this is a valuable option for me, i.e. using"$Prompt"). So I am more or less safe, but well, they better fix this for all sorts of ways to connect. – Pinguin Dirk Sep 12 '13 at 07:34