View Single Post

  #2 (permalink)  
Old 10-11-2005
Axel Schwenke
 
Posts: n/a
Default Re: access to database

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
Reply With Quote