Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

MySQL Database

by tanger (Scribe)
on Mar 02, 2002 at 20:34 UTC ( [id://148890]=perlquestion: print w/replies, xml ) Need Help??

tanger has asked for the wisdom of the Perl Monks concerning the following question:

Hello:

I'm building a database frontend and program for the Attorneys to input data and recieve data and cases. I'm planning to use MySQL as a database. (Any other database suggestions for this type?) Each Attorney will have its own log-in / password. Should I have the username/password as the MySQL user/password? Or should I use a flatfile with password encryption or something?

I never really built a cgi script that involves secure password data, so im sort of new to this field.

Anthony

Replies are listed 'Best First'.
Re: MySQL Database
by simon.proctor (Vicar) on Mar 02, 2002 at 21:08 UTC
    My suggestions would be:
    1. Every user has a username and password stored in the database in a table, password is encrypted
    2. The username and password for the database as a whole is for your eyes only.
    3. Use a templating system, I suggest the Template Toolkit or HTML::Template.


    MySQL is fine for this task. If you want to consider other database engines then I would recommend Postgres. You can find out more about via a mirror found here.

    I'd also read up on Ovids CGI tutorial..

    Hope that helps
    Simon
Re: MySQL Database
by perrin (Chancellor) on Mar 02, 2002 at 23:14 UTC
    Here's one reason not to have separate MySQL logins for each user: persistent database connections. Using mod_perl or FastCGI, you can improve performance of an application by keeping persistent connections to the database server. If you only have one database login, you only need one connection per process. If you have multiple logins, you need one connection per login per process. That can add up fast and swamp your database.

    Make the right architectural choice now and you will save yorself a lot of hassle later on.

      There's really very little speed improvement in using Apache::DBI for persistent connections to MySQL. My own benchmarking never demonstrated any notable improvement from simple non-persistent connections.
        There's definitely some improvement, since there is less work to be done when you have a persistent connection. It also leaves the door open for switching to another database at some point down the road.
Re: MySQL Database
by lachoy (Parson) on Mar 02, 2002 at 21:41 UTC

    You might get a big helping hand by using one of the various application servers out there (like OpenInteract, OpenFrame, HTML::Mason). With OpenInteract, the authentication stuff is already built-in, as is interaction with the database and a rich templating environment for creating applications fairly quickly. But such systems might also be overkill if you've got a fairly simple task ahead of you.

    Chris
    M-x auto-bs-mode

Re: MySQL Database
by ropey (Hermit) on Mar 03, 2002 at 01:35 UTC
    From what your saying I think.... Use MySql, its is small application so ...Add a 'users' table, In its simplest form it should consist of a user name and password. For the password encrypt it and store it (easiest is to use a MD5 hash, it is a 1 way encryption process)When a user logs in and enters there password, you encryprt what they enter and compare it to what is stored in the DB. If you do not need the extras like commit/rollback MySql is brilliant, personally my company use Sybase but for small scale applications MySql does the job.. HTH !!
Re: MySQL Database
by Ryszard (Priest) on Mar 13, 2002 at 01:03 UTC
Re: MySQL Database
by emcb (Beadle) on Mar 02, 2002 at 22:15 UTC
    I would suggest using Oracle with oraperl. But as it's over 550 megs in download, and mySQL is a good db managment server you should just stick with it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://148890]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-19 06:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found