[plug] MySQL for PostgreSQL users

Tim Bowden tim.bowden at westnet.com.au
Fri Sep 19 12:32:59 WST 2008


On Wed, 2008-09-17 at 13:44 +0800, Peter Wright wrote:
> On 17/09 11:19:38, Tim Bowden wrote:
> > Hi all,
> > I've got to use MySQL instead of my preferred PostgreSQL (wordpress
> > dependency.
> 
> Funny - I was about to say that Wordpress runs on PostgreSQL (I
> genuinely thought that was the case), but it turns out I'm completely
> and utterly wrong:
> 
> http://wordpress.org/support/topic/549/page/2

And I've added a new thread so in another four years we can revisit the
issue with no change:
http://wordpress.org/support/topic/204490?replies=1#post-855144

If you want to see PostgreSQL support (ignored again) in WordPress,
please add your $0.02.

> 
> I can understand why the Wordpress developers would put it into the
> too-hard-and-we-don't-care-enough basket, but yeah, it's annoying.
> 
> > Why oh why can't open source projects be database agnostic.  We have
> > an SQL standard for a reason),
> 
> *An* SQL standard? :-)
> 
> And every major database vendor implemented their own extensions/
> violations of the SQL standard for a reason, and then once they'd done
> that they couldn't easily break backwards compatibility with previous
> versions of their own software merely to provide greater compatibility
> with a standard that not terribly many people care about. :-/
> 
> Yes, it sucks.
> 
Ok, so SQL can be a mess, but I'm sure nothing very fancy is happening
in WP.  It /should/ be possible to write things in a db agnostic way
(says me who doesn't actually know how WP uses MySQL and is making
dangerous assumptions). 

> > but I'm not quite understanding the MySQL user/security model yet.
> 
> Join the club :-). It's never made a lot of sense to me either.
> 
> I think Daniel's response is pretty accurate as far as I can recall,
> but I try to do as little as possible with MySQL and just stay the
> hell away once I've got the damn thing working.

That's a sentiment I fully understand, but I need to get it working
first.  It's now a time sensitive issue for me.

> 
> 
> The four commands I use most at the MySQL prompt are:
> 
>   > show databases;              -- equivalent to 'psql -l'
>   > connect database_name;       -- equivalent to 'psql database_name'
>   > show tables;                 -- equivalent to psql's \dt (once
>                                     connected to a DB)
>   > desc table_name;             -- equivalent to psql's \d table_name
> 

Most helpful.  That was info I was wondering about.  Perhaps I should
develop a MySQL cheat sheet for PostgreSQL users out of this experience.

> One thing worth keeping in mind with MySQL is that (at least for
> *some* versions, not sure if it still does this in the latest version)
> it tries to be clever and ends up violating the Principle of Least
> Astonishment.
> 
> For example, I ran into a really irritating problem recently where
> doing something like:
> 
>   $ mysql -u username -p -h localhost
> 
> (ie. connect to localhost as user "username", ask for password) would
> throw a bizarre error about not being able to find the appropriate
> mysql.sock file (used for Unix socket connections, which are
> completely different to TCP connections - and this particular MySQL
> was misconfigured so there was no .sock file available).
> 
> It turned out that that version of MySQL would try to be "clever" and,
> if you supplied "localhost" as the host, would silently decide that
> you must have really wanted to do a Unix socket connection. So it
> would try to do that and of course fail, leaving me utterly confused.
> 
> Only if you supplied '-h 127.0.0.1' instead of '-h localhost' would it
> do a proper TCP connection. Grrrrrrr.

Oh, that is evil.  Thanks for the warning.  It's the sort of snafu that
can waste hours.

> 
> > Regards,
> > Tim
> 
> Pete, now having flashbacks to all the other reasons he hates MySQL.

And I'm learning my own.  The pagination of output in the mysql client
is (more or less) nonexistent, unlike in psql where it (more or less,
take your pick) works beautifully.

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