[wplug-internet] Can I create a new MySQL database?

Pat Barron pat at lectroid.com
Tue Feb 14 12:04:29 EST 2012


On 02/14/2012 1:13 AM, Vance Kochenderfer wrote:
> I believe Pat was going to use an ssh tunnel (i.e., 'ssh -L
> 3306:localhost:3306 user at wplug.org') to communicate with MySQL.
> This way, only the data lives on the server; the application is
> entirely on his desktop.

Exactly.  I talked to Ted a little bit yesterday and clarified that.

I did a proof-of-concept at home last night (using Postgres as a 
back-end, just because it's what I happen to have running at home).  
Seems to work fine, and no GnuCash bits need to be installed on the 
server side.  Just uses the DB for data storage.

> This seems fine to me, with the proviso that we create a separate
> MySQL user that *only* has access to this database.  Principle of
> least privilege and all that.

Works for me.  ;-)

> Pat, one thing to keep in mind is that the next treasurer may not
> want to use the same tools.  I know that at least once in WPLUG's
> past, a treasurer has handed over his data files which were then
> ignored by his successor.  I'd recommend, in addition to the
> database, generating something in plaintext that can be picked up
> by anyone.  Here's the format I used, FWIW.  :)
> <http://www.wplug.org/pipermail/wplug-board/2010-April/001703.html>

True.  That's why I'm trying to make it as simple as possible.  I intend 
to have Treasurer's Reports in roughly the format you describe (to 
present at board meetings and GUMs), but that's just a snapshot in 
time.  A "real" accounting system lets you view the history too.

But yeah, my eventual successor would not necessarily care to do that.  
So by keeping it relatively simple, if the work gets thrown away later, 
it's no big loss.  ;-)

> To be honest, if MySQL can meet your needs, I'd prefer not to run
> Postgres.  Just want to avoid having another service to keep an
> eye on.

MySQL would be fine.  I just understand Postgres better (and run it at 
home), have been a Postgres user for a very long time.  So I'm a bit of 
a Postgres bigot.  But there's nothing Postgres can do for me that MySQL 
can't.

> As I see it, you'd need:
> 1. A MySQL username
> 2. A password for that user
> 3. A database (CREATE DATABASE gnucash ?)
> 4. Privileges for the user on that database
>
> Does any particular schema need to be set up for GNUcash to use?
> Am I forgetting anything else?

I think that's it (and yeah, the DB name it expects is "gnucash" - the 
version of GnuCash I'm running on my desktop seems to get unhappy if the 
DB is called anything else, at least using the Postgres back-end).  The 
user that accesses that DB doesn't need to have any access to anything 
else.  GnuCash initializes the DB (with all the tables it needs and 
such) when you first set it up, all it needs going in is a "blank" 
database and access to it.

--Pat.




More information about the wplug-internet mailing list