Multiple "From IP"s in user manager

[expired user #10165]'s profile image [expired user #10165] posted 8 years ago in General Permalink

When creating a new database user in user manager, I'd like to be able to specify multiple IP addresses from which a connection can be made using this login. Is this possible?

ansgar's profile image ansgar posted 8 years ago Permalink

You can always use some wildcard in the "from" field. For example "10.127.%". As far as I know you can also use a netmask here, like "10.127.1.0/26"

[expired user #10165]'s profile image [expired user #10165] posted 8 years ago Permalink

Thanks - although that doesn't quite solve my problem. I'd like to restrict access via this login to a few quite distinct IP addresses.

kalvaro's profile image kalvaro posted 8 years ago Permalink

When creating a new database user in user manager, I'd like to be able to specify multiple IP addresses from which a connection can be made using this login. Is this possible?

There shouldn't be any problem. In fact that's the default for root user, at least on Windows distributions of MySQL:

[expired user #10165]'s profile image [expired user #10165] posted 8 years ago Permalink

Ah, yes indeed... so I just create multiple "users" - all with the same username and password, just changing the "From host" in each. Thank you.

[expired user #10165]'s profile image [expired user #10165] posted 8 years ago Permalink

Seems to be a danger though of making a mistake... suppose I inadvertently assign different privileges to each? Or different passwords? The interface allows me to separate IP's with semi-colons - eg I can add, as the "From host" IP1;IP2;IP3 etc But is this valid? I suppose, with some effort, I could do some testing - but do you (does anyone) know?

kalvaro's profile image kalvaro posted 8 years ago Permalink

It's certainly intentional and confusing but that's how MySQL Server works.

The syntax is documented here. I understand it's supposed to be a single host name or network and (I've just tested) MySQL Server does not do any kind of validation so I presume (I haven't tested that) that such user will just never match any connection host and remain unused. So, yes, it'd be a nice bonus to get some validation in HeidiSQL itself.

Please login to leave a reply, or register at first.