FredHutch / DB4SCI

Containerized Database Service (DBaaS)
Apache License 2.0
7 stars 3 forks source link

Creation of MariaDB container fails if db/container name contains a dash #9

Open bdconnolly opened 4 years ago

bdconnolly commented 4 years ago

Repo:

  1. Click on menu item to create a new MariaDB container
  2. In DB/Container name field use a name with a dash. For example "test-database"
  3. In DB Username field enter a username
  4. In DB Password field enter a password
  5. Complete other required fields in the database
  6. Hit the Submit button

What should happen: A new database container is created with the name entered in 2) above. Using the username and password entered above you should be able to access it with a command similar to

mysql --host mydb --port 32246 --user test-database --password

What happens: A new database container is created with the name entered in 2) above. Using the username and password entered above you are unable to login. You see a message similar to

mysql --host mydb --port 32246 --user testuser --password
Enter password:
ERROR 1045 (28000): Access denied for user 'testuser'@'rhino02.fhcrc.org' (using password: YES)

After debugging the problem on the db4sci server, I was able to determine the problem is with the password. The DB container is created correctly. The DB is created correctly and the user is created, however the password does not work. When the password is changed, the user is able to access the DB.

dtenenba commented 4 years ago

I mentioned in another issue that dashes are not allowed in mysql/mariadb database names. So the real issue is that mydb is not doing the proper validation/error handling to prevent names with dashes from being used.

dtenenba commented 4 years ago

Actually, I am having trouble finding a reference for my statement above (that dashes are not allowed in database names). I wonder if the dash throws off the parsing of the command line so that it interprets some other argument as the password....