Re: Newbie- Can I create a new MySQL database from within my app?

From: Ian Hinson (pparagon_at_bigpond.net.au)
Date: 12/18/04


Date: Sat, 18 Dec 2004 17:40:20 GMT


"Mike Barnard (at work)" <junk@thunderin.co.uk> wrote in message
news:drt6s0lt1sc4rajkoff4rs9ne9q95dj655@4ax.com...
> On Fri, 17 Dec 2004 11:17:00 -0000, "J West" <jimw@fluffypaws.co.uk>
> wrote:
>
>>I have no experience of creating a database in code (Not something I would
>>recommend doing) but there are distribution utilities available for MYSQL.
>
> Hi.
>
> Remembering I'm a REAL newbie, why would you not reccomend this? In a
> finished application, if an end user wants to start another database
> would you normally say to them "No, the program you've bought from me
> doesn't do that. You'll have to also learn how to run MySQL just to
> start up.". To *me* that doesn't make sense.

I recently wrote a Delphi app that connected to a MySQL server.
The only reason I went down that path was that the MySQL server was already
up and running (on a Linux server also running Apache) and the customer
wanted a nice Windows GUI app to view and manipulate data with.
But if I was to write a standalone app from scratch for distribution to
customers that don't already have MySQL (and haven't specifically asked for
it!) there's no way I'd just decide that my "backend of choice" would be
MySQL.
Setting up a MySQL server and learning how to do even simple things like
create a database is a helluva learning curve. It's definitely out of the
realm of the typical end user, and even some programmers would struggle with
learning MySQL if they've had no real exposure to SQL and database admin in
general.

FWIW, MySQL can easily reproduce a database and its tables by importing from
an "sql dump" that contains all the CREATE TABLE etc statements.
Doing it from inside a program might be possible via the LibMySQL.DLL.
(Now that's a whole new learning curve in itself)

But before you even get to that stage you should familiarise yourself with
the general workings of MySQL such as how to set up user accounts and
passwords, permissions, how to use the mysqladmin utility etc. The user
manual is 1200 pages (good luck) and mostly it's all about horrible text
based DOS window stuff.

> In the instance I am thinking of, the tables would be fixed in design,
> and easily reproducable. It's just that other instances of it (for
> say different years or different (same job) organisations) would be
> needed to be created.

Erm. How good is your knowledge of sound database design? One thing sticks
out like a sore thumb: You shouldn't need to be creating a new instance of
the whole database every year else something is fundamentally wrong with
your db structure.

Could I recommend for anyone who might some day need to connect to MySQL
from a Delphi app that you can't go past setting up the MyODBC driver then
using Delphi's ADO components via "Microsoft OLE DB Provider for ODBC
Drivers". (I gave dbExpress a shot, but IMHO the ADO route was much more
straighforward.)

Ian.



Relevant Pages

  • Re: MySQL Database problem (probably already solved in a message, but this is somewhat urgent)
    ... MySQL server has a database with a table, ... columns, an FSR column, and a password column. ... checked if the supposed arrays that were returned were actually arrays ...
    (comp.lang.php)
  • RE: FreeBSD 5.3 MySQL Performance
    ... versions of Linux and FreeBSD for most tests. ... > popular with the ATA disk drive manufacturers. ... > Many companies have used FreeBSD and MySQL for years and years. ... it is not often that you have such a small database and such a large ...
    (freebsd-questions)
  • ANN: Database Designer for MySQL version 1.6 is released
    ... The new version 1.6 of MicroOLAP Database Designer for MySQL has been ... The secure shell (SSH) tunneling is now implemented in Database ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: toolkits or APIs to create a web interface as a frontend to mysql
    ... I am also *not* looking for a web based full fledged mysql client. ... For simple display of tabulated data the most useful thing is a displaywhich uses 's with absolute coordinates to position text in a box of defined width, formatted to be left, right or center justified, an using a preselected style from a a style sheet. ... As far as the actual database calls go, those are specific to each form, and apart from a little coding so that 'database_open, database_close' exist in the library, taking such things as the database name, user name and password from an included file I find it easiest to simply do the query and iterate through it to display the data requested. ...
    (comp.os.linux.misc)
  • Re: PICK OPENDB provides connection in shopping cart startup
    ... we MIS folks are required to take on tasks that we don't ... developer, nor the database. ... Why do you need MySQL?. ... in size that KTP experienced, evolving to the current 90,000+ sq. ...
    (comp.databases.pick)