-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Benjamin, et al --
[I couldn't find your public key... Is it on a keyserver?] ...and then Benjamin Pflugmann said... % % Hello. Hi! % % On Fri 2002-12-27 at 20:15:22 -0500, [EMAIL PROTECTED] wrote: % [...] ... % > Soooooo... When you experienced folks write software that's meant to be % > installed from a script or such, do you lead off with a 'drop database' % > command, or is that just too dangerous to put in a script % % I would think so. I'm going to figure you think "too dangerous" rather than think "lead off" based on your comments below :-) % % > and you make your users clean up any old installation by hand? % % I would at least require them to do something special (use a --force % flag or call a seperate cleanup script, or whatever). I was thinking about a cleanup script; it sounds like that's the way to go. % % > This will have to be run by a root user, so we can figure that this % > user might have read the docs and know that he's going to start % > [over] from scratch, but then, again, users are users :-) % % Even if most people would read the docs (that's not my experience, not % even for those having root privileges ;), the problem is that the Yeah, yeah :-) One *hopes* that with power would come responsibility, but in this loose age... % damage could be relativly big. And the greater the possible damage the % more conservative your scripts should be. OK. Sounds like sage advice. % % > Meanwhile, is there if/then/else functionailty in SQL so that I can say % > % > if exist dbname exit "some error" ; % > create database dbname ; % > ... % > % > and not try to create and populate a database on top of an existing one? % % Since there is a flag --force to the mysql command line client, which % will force continuation in case of sql error, it sounds as if the % default behaviour of the tool already is to bail out on error. If not, % it's a bug (either documentation of behaviour). Oh :-) Well, so I tried it; I commented out the drop and reran my script, and it quit at ERROR 1007 at line 3: Can't create database 'dbname'. Database exists so it looks like it doesn't continue. Good; I won't be trying to make stuff on top of stuff. % % > Or is there perhaps a "RENAME DATABASE" command (I saw RENAME TABLE) so % > that I could rename the old one to get it out of the way but not toss it? % % If you do not restrict yourself to a SQL script, but a shell script % which calls mysql to execute some SQL, you could react very flexible % on the concerns you mentioned. Yeah. There will be an installation script (probably shell, because of its portability, but perhaps perl for power) so I can just take the extra steps of detecting the database and getting rid of it as a subtask. % % HTH, It does; thanks! % % Benjamin. % % -- % [EMAIL PROTECTED] HAND & Happy Holidays :-D - -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" http://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQE+DXJ9Gb7uCXufRwARAvBPAKDIg9bz9cHpSPDt06kGZ99pgxH+EwCggMNr TRignFqywNlCFDLVrkRMO0Q= =HCwW -----END PGP SIGNATURE----- --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php