On Wed, Mar 20, 2002 at 11:20:27AM -0000, Kenn Humborg wrote:
> But the problem is still getting this username/password pair
> to the MySQL server in the first place.
>> For a Win32 client, I could do like a POP3/IMAP mail reader
> does: prompt the user for a username and password at
> application startup and (optionally) cache these credentials
> somewhere in the user's NT profile (i.e. the API referred to
> above). It's ugly, but maybe the only practical way.
No - it's been a little while since I did this but AFAIR the 'doze ODBC
setup solves it for you for 'doze clients. When you use ODBC to connect to a
MySQL (and other) server, you must define named connections - properties of
these connections include server details including database, username and
password. Then your client simply uses that connection. I've only tried this
with access but I presume the principle is the same for home brewed clients
- download MyODBC and put it on a 'doze box and have a look - it's not
difficult. ODBC connections can be system or user based and are defined in
the ODBC control panel.
> For a web-based front-end, maybe I do it this way:
>> o First page is a login page. User provides a username
> and password.
>> o PHP script uses these credentials to connect to MySQL
> and "caches" this database connection.
>> o PHP script returns a cookie to the browser that refers
> to the cached connection.
>> o Further scripts re-use the same connection.
PHP has the ability to keep a pool of open database connections.
> However, I see a couple of possible issues here:
>> o AFAIK, the MySQL connection is a TCP connection or
> or a Unix domain socket. Is this something that I
> can easily cache and reuser in the PHP/CGI programming
Yes - see above and the abundant PHP documentation out there.
> o What happens if I run multiple simultaneous queries
> over the one MySQL connection (say user has multiple
> browser windows open)? Do queries have to be serialised?
No, MySQL is multi threaded, although it's not the best database in the
world for multiple writers. Very fast for multiple readers though.
> Is there anyone here who has either
>> o Done something like this?
Yes, lots of us.
> o Uses something like this in their day-to-day work and
> can comment on the pros and cons of their system's
The web stuff is rock solid. Can't comment on the 'doze stuff as I haven't
used it enough. Ask again in a few months when I am, sadly, likely to know
> o Pointers to literature for further reading?
Amazon / Google / www.mysql.com / www.php.net
> Basically, I'd like to have something reasonably secure without
> users having to remember more passwords and without users
> having to re-enter their passwords all the time.
Hmm - it's the ssh-agent discussion all over again :-)
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!