grant all privileges on dbname.* to userid@"%" identified by 'passwd' // % means that any host can access that database
grant all privileges on dbname.* to userid@localhost identified by 'passwd'
grant all privileges on dbname.* to userid@212.123.23.12 identified by 'passwd'
flush privileges; // tell the server to reload the grant tables.