mysql - new database login denied

Hi guys,

I think I found bug within mysql. When you log into virtualmin, select doman and then create new database for example test database is created. when you try to log into database be it via phpmyadmin as:

username: test

password: same as domain user admin password

it will give you an errror: mysqli_real_connect(): (28000/1045): Access denied for user 'test'@'localhost' (using password: YES) - i've updated server this morning and since then any new db associated with server wont connect. Issue is still there even if you login as root and update database permission to allow all for particular user. Existing dbs are not affected. Is this bug or something changed?

Status: 
Closed (fixed)

Comments

unborn's picture
Submitted by unborn on Thu, 03/09/2017 - 05:18 Pro Licensee

edit: everything updated, phpmyadmin and system as well. debian jessie 8 - 64bit

Howdy -- hmm, we hadn't heard of other reports of that occurring after recent updates, though we'll keep an eye out for that.

What is the output of this command:

dpkg -l 'mysql*'
unborn's picture
Submitted by unborn on Fri, 03/10/2017 - 04:00 Pro Licensee

Morning, yes I never had that issue before.. output of command is here: http://suba.uk/l/mysqldkpgl1

I can create sort of screencasting for you so you could see what it is happening.. if you want

unborn's picture
Submitted by unborn on Sat, 03/11/2017 - 05:16 Pro Licensee

guys sorry to bump this but any update regards this ? thanks.

Was the username actually "test" ? Because by default MySQL uses that for a default test account.

Welshman's picture
Submitted by Welshman on Sun, 03/12/2017 - 11:20

What happens if you create a new user for the database and give him permissions?

Using domain owner pwd is never a good idea for use with anything other than VM access.

Have you asked at the mysql and myphpadmin sites about this?

Welshman's picture
Submitted by Welshman on Sun, 03/12/2017 - 13:48

Try a screen cast creating a new user, making sure they have the correct permissions, do not give them all permissions as that is not good. And we can see how it all should go correctly.

I can do one as well if you like.

unborn's picture
Submitted by unborn on Sun, 03/12/2017 - 13:49 Pro Licensee

@Welshman

hi, that works of course, question was about this as I want to keep dbs associated with server which is good idea specially for backups.. Mainly in development.. that dev server is just one dummy domain so it was usually very fast to create new db for me and do my dev work there in end of the day that is what it supposed to do if db is associated with domain. I was thinking to creating separate user for each db and then adding them to vm domain but that is opaque of how it should work and having two users for one db is just - uhm..you know.

Asking those sites about what? I dont understand, sorry. Like what was changed in update or something? Please note that I know how to use those tools.

unborn's picture
Submitted by unborn on Sun, 03/12/2017 - 13:56 Pro Licensee

@Welshman

once again, I am asking about new dbs created via virtualmin and associated with virtual server, but thanks for your suggestions

Welshman's picture
Submitted by Welshman on Mon, 03/13/2017 - 11:04

Hi unborn, I noticed in the past and have mentioned it, the auto install script for roundcube for eg, I use gpl so am limited, but it uses the main domain server pwd for the database.

Not wise as if you should have a dev/outsider working on your site for whatever reason with file access, they can see the pwd of the domain/VMboss which is like leaving a key to a bank vault just outside the door.

I think what needs to be done is that any application installed etc is forced to a new database user and not automatically use the main user and pwd for VM access which could have hundreds of domains in it's virtual setup.

And so affect a lot of ... fill the blank in if you like.

unborn's picture
Submitted by unborn on Mon, 03/13/2017 - 14:37 Pro Licensee

Hi Welshman, surely I understand what you mean, only domain admin should have access for dbs not other users.. other users be it logins for roundcube or other cmses should use other logins. I do not see any reason why normal user should know any login to webmin nor databases. If your client is just some user who use your cmses he should not have any access to those anyway. Only site admin, which he should have access to all its own virtualmin login. Logins to databases as domain owner will let him to use only his own databases and if user logs in to one database he would be able to work only with that one database...not with rest of those databases associated with that server..... I thought you knew this already.

Anyway thats is what I am asking here. New database uses its own login - db name, with main password. Of course you can create 100 sql users with separate passwords etc.. I think you do not understand what I was asking man.. no offence.

I am gpl user as well and roundcube auto install is there in gpl version - I dont get what limits you talking about - but I do not use it as I had issues with it in past after some upgrades. I use webmail with sqlite.

For now I am using it as this.. create separate user with separate db, and then associate with server. Also I am closing this issue.

Thank you for your suggestions.

unborn's picture
Submitted by unborn on Sun, 03/19/2017 - 07:47 Pro Licensee

Status: Active ยป Closed (fixed)