This is a discussion on access to database within the MySQL Database forums, part of the Database Forums category; hi to everybody. i'm a newbie in the world of mysql and i've got a problem with the ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
hi to everybody.
i'm a newbie in the world of mysql and i've got a problem with the access to a database. i created a user 'default', from host %, with his password and give him access to a database (all privileges, with grant option). when i try to access it from an application i get an exception (access denied for user 'default'@'localhost'). i can access the database only by user root. thenk you for your help Francesco -- Posted via Mailgate.ORG Server - http://www.Mailgate.ORG |
|
|||
|
francesco wrote:
> i created a user 'default', from host %, with his password and give him > access to a database (all privileges, with grant option). > when i try to access it from an application i get an exception (access > denied for user 'default'@'localhost'). The MySQL privilege system clearly distincts between 'local' connections and 'network' connections. A '%' in the host column matches all network connections but *not* local connections. If you want to connect from both localhost and via the network you have to GRANT privileges twice. One time for '%', one time for 'localhost'. However I discourage from using '%' in the host column. In most cases a network name or IP address range is more appropriate. XL |
|
|||
|
thank you: now it works (and i'll avoid using '%')
Francesco -- Posted via Mailgate.ORG Server - http://www.Mailgate.ORG |
![]() |
| Thread Tools | |
| Display Modes | |
|
|