If MySQL is installed without specifying a password, then that database connection cannot be used in the 'Use Database
..' action to create JDBC resources.
- install MySQL without a root password (or change the root password to blank)
- connect to MySQL and create a new sample database
- the database connection is successfully created
But this connection cannot be used to create a JDBC resource. This is a valid usecase.
So what should be the expected behavior?
see issue 149286
In servlet I am able to call Use database action -> Add reference -> Add project data source -> select mysql connection without pasword -> and finish the
wizard. Closing as WFM. Feel free to reopen with exact steps to reproduce.
I am still able to reproduce this issue using the following steps,
- Register a sampledb (for MySQL) with no password. Note, I checked the box to save password.
- Try to create a datasource with this connection using 'Use Database..' action worked.
- Shutdown and Start the IDE.
- Go to project and attempt to create a datasource with the same connection using 'Use Database..' action
- This gives error message : ' The password must be provided, otherwise the data source cannot be created'
I don't remember having restart the IDE to get into this situation yesterday, but I could be mistaken.
Attached screenshots s
Created attachment 71422 [details]
Created attachment 71423 [details]
Tomasi (asking you as an author) - DataSourceReferencePanel.isEnabled depends on whether password is null. Is that correct?
DatabaseConnection.getPassword() can be null even in this valid usecase of empty password.
Really hard to say, I'm not sure; but seems to me that the check is OK - at least if you have a look at
DatasourceComboBoxCustomizer:164 you can see that the check is there and if the password is null, false is returned
and the customizer is then invalid (that code was there before I made my changes).
Yes, I was looking there and that check should be disabled. I tried to do that and fix was pretty simple. Anyway, I would like to discuss this with Andrei
(should be able to see the things from DB point of view) on monday before applying it.
After discussion with Andrei, I decided to downgrade to P2. Main reason is that using mysql without password is very rare and it still can be fixed by setting
one. Also from the implementation point of view, it is quite undefined on how DatabaseConnection.getPassword() is behaving and it will require bigger effort
also in DB modules to ensure proper behavior.
Any changes in this area in 7.0 so that this address can be addressed ?
From the thread I feel like its related to databases. Assigning to David. David, please resend it if you think its not
I'm not sure what to do here. Can somebody explain the problem from the Database Explorer API point of view? A
database password can be null, and when it is, we return null when you say getPassword().
One thing that happens is when the password is saved, we save it as an empty string, otherwise savePassword checkbox
doesn't work, because we think the password is empty instead of saved. So next time you call getPassword(), it returns
an empty string.
I think the problem may be related to the age-old problem between NULL (not specified) and "none" - specified, and it's
But again, I'm not sure what exactly the problem is and how I can fix it...
Reassigned to new owner.
David's question hasn't been answered yet, I'm going to close as WFM.