Bug #70663 New User Not Created Properly
Submitted: 19 Oct 2013 0:43 Modified: 23 Oct 2013 0:43
Reporter: Nick Apperley Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Workbench: Administration Severity:S2 (Serious)
Version:6.0 OS:Linux (Linux Mint 13)
Assigned to: CPU Architecture:Any

[19 Oct 2013 0:43] Nick Apperley
Description:
In MySQL Workbench a new user was created with a password. Tried to test the connection in the "Setup New Connection" dialog but had a dialog pop up saying "Please enter password for the following service:". After entering in the correct password the connection failed with the "Cannot connect to Database Server" message popping up. The previous dialog should have popped up again.

Checked to see that the user existed by logging in as the new user via the mysql program, but access was denied (ERROR 1045 (28000)). Current workaround is to create the new user using the mysql program instead of the MySQL Workbench application. Using the workaround there are no issues with logging in the new user via MySQL Workbench.

Running MySQL Server 5.5.32 on Linux Mint 13 (Ubuntu 12.04 based).

How to repeat:
1. Start MySQL Workbench
2. Login as root user
3. Under Management click on "Users and Privilages"
4. Click on "Add Account" button
5. Fill in "Login Name" field
6. Fill in "Password" and "Confirm Password" fields
6. Click on "Apply" button
7. Close connection
8. Beside MySQL Connections click on plus button
9. Fill in "Connection Name" field
10. Fill in "Username" field
11. Click on "Store in Keychain" button and enter in password
12. Click on "Test Connection" button
[19 Oct 2013 22:55] Nick Apperley
As it turns out there were 2 anonymous users in the DB server. After removing both users, and creating the new user again I was able to login as the new user. Surprised that MySQL Workbench does not provide a warning that an anonymous user exists on the DB server.

Alternatively MySQL Workbench shouldn't allow a new user to be created if an anonymous user is detected on the DB server. No doubt plenty of people are caught out by the anonymous user issue when creating a new user, thinking they can login as the new user but end up with a confusing error message instead.
[22 Oct 2013 14:02] MySQL Verification Team
Thank you for the bug report. I couldn't repeat on Mint Nadia/CewntOS 6.04. About anonymous user see http://dev.mysql.com/doc/refman/5.5/en/default-privileges.html . Thanks.
[23 Oct 2013 0:43] Nick Apperley
Below are the revised steps taken to reproduce the bug:

1.  Start MySQL Workbench
2.  Login as root user
3.  Under Management click on "Users and Privileges"
4.  Remove all anonymous users (if they exist)
5.  Run the following SQL to create an anonymous user:
      create user ''@'localhost';

6.  Remove sample database (if it exists)
7.  Create sample database
8.  Go back to "Users and Privileges" tab
9.  Click on "Add Account" button
10. Fill in "Login Name" field
11. Fill in "Password" and "Confirm Password" fields
12. Click on "Schema Privileges" tab
13. Add an entry for the sample schema with the following privileges:
      * Select
      * Insert
      * Update
      * Delete

14. Click on "Apply" button
15. Close connection
16. Beside MySQL Connections click on plus button
17. Fill in "Connection Name" field
18. Fill in "Username" field
19. Click on "Store in Keychain" button and enter in password
20. In "Default Schema" field enter in sample
21. Click on "Test Connection" button