[plug] MySQL for PostgreSQL users

Tim Bowden tim.bowden at westnet.com.au
Wed Sep 17 11:19:38 WST 2008


Hi all,

I've got to use MySQL instead of my preferred PostgreSQL (wordpress
dependency.  Why oh why can't open source projects be database agnostic.
We have an SQL standard for a reason), but I'm not quite understanding
the MySQL user/security model yet.  I'm not looking to become a MySQL
master (I'd rather play in the PostgreSQL sandpit) but could someone
please take pity and check my steps or give me a succinct set of steps
to create a user and db that can be accessed only from localhost that
has no privileges beyond those required to manipulate the given db.

So far:
CREATE USER 'username'@'localhost' IDENTIFIED BY 'mysecret';
CREATE DATABASE mydb;
GRANT ALL ON mydb.* TO 'usrname'@'localhost';

Q.  How does MySQL treat 'username' as opposed to 'username'@'localhost'
or 'username'@'somehost'.  Are they all the same user just with
different rights depending on where they connect from (which is what I
think is happening), or are they completely different users?  What I've
read has been a bit ambiguous here.

Regards,
Tim
-- 
Experience is that marvelous thing that enables you recognize a mistake
when you make it again.




More information about the plug mailing list