mysqldump - basic question
this is an absolute newbie question - but when i try to run mysqldump with a cron (like with a shell script) i can't because mysqldump utility stops to ask for a password. how can I either embed the password or set up mysqldump to not ask for one if, for instance, root is running the shell script? thanks, rory - 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
efficient DELETE query - 2 tables
I want to write an efficient query that will delete all records from one table when they show up in another table (pending shipments --> shipped shipments). I can't do it with this: mysql> DELETE from pending_2 WHERE pending_2.ordno = ordersearch_2.ordno; because you can only refer to columns of one table in a delete query. Does anybody have an effiecnt way for me to do this with Perl DBI? Thanks! Rory - 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
MYSQL-based commerce packages
I'm looking for a new commerce package, something run of a MySQL database. it's gotta have bulletproof (well, as close as you can get) session management. I wonder what others on the list are using and like? input is appreciated! thanks! - 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
Re: duplicate delete query
I want to leave one record behind, but delete all other records that have the same e-mail address. Is there a standard query for this or do I need to write a script that will do it? THanks, Rory On Thu, 30 Aug 2001 22:35:48 -0500, "Rory O'Connor" <[EMAIL PROTECTED]> wrote: >Do you want to delete all records which have duplicates, or do you want to >delete all the duplicates but leaving one copy of each duplicated record >behind? > > >----- Original Message - >From: "Rory O'Connor" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Thursday, August 30, 2001 4:50 PM >Subject: duplicate delete query > > >excuse me if this is too newbie...but I need to perform a duplicate >delete on my database using the e-mail address as the key. I understnad >how to use COUNT and DISTINCT together... > >select count(DISTINCT email) FROM table; > >but I can't seem to find any info on how to perform the actual deletion >of the duplicate records. Any info is appreciated! > > > > >- >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 > > > providing the finest in midget technology - 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
duplicate delete query
excuse me if this is too newbie...but I need to perform a duplicate delete on my database using the e-mail address as the key. I understnad how to use COUNT and DISTINCT together... select count(DISTINCT email) FROM table; but I can't seem to find any info on how to perform the actual deletion of the duplicate records. Any info is appreciated! Thanks! providing the finest in midget technology - 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
re-indexing records
I'm a bit of a mysql newbie...excuse if this is rudimentary. I imported about 5000 records and realized that the index is a bit scewy since i deleted alot of records while it was in access. rather than fix it in access and re-import it, is there an easy way to re-index the records in mysql? thanks! providing the finest in midget technology - 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
2 programs - 1 database
I am using a PHP script and a separate perl script, and they are operating on the same MySQL database. I am fairly new to MySQL (and programming in general), and I'm wondering if this could cause any problems - especially during peak traffic times. Are there measures I should be taking to minimize the risk of data loss or lockup (other than the obvious backups)? I used to work with a perl script of a flatfile database and it would start doing *very* strange things during peak traffic times. Thanks, Rory providing the finest in midget technology - 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
properly checking for existing records with perl
I am writing a small perl script that will write data to a Mysql database. The SQL will need to be different based on whether or not the e-mail address already exists in the database though. I coded something that works, but I would like some feedback as to whether or not this is the best way. I need this to be as efficient as possible because there is occasionally very heavy traffic on it, and there will be over 100,000 records in the database. Basically, I collect the data, then I query the database to see if the e-mail exists. and if it returns row(s) then I update the data to the database. if it doesn't, i insert the new data into the db. any help is appreciated! here's the code snippet: # see if the e-mail exists $query = "SELECT email FROM $table where email = \'$email\'"; $dbh = DBI->connect("DBI:mysql:database=$database;host=$host","$user","$mysqlpa ssword",{'RaiseError'=>1}); $sth = $dbh->prepare($query); $sth->execute(); $numrows = $sth->rows; # if there are rows returned, the e-mail is in there, so we need to update the record if ($numrows ge '1') { # set the SQL for UPDATE $sql = "UPDATE $table SET prefix=\"$prefix\", firstname=\"$firstname\", middlename=\"$middlename\", lastname=\"$lastname\", address1=\"$address1\", address2=\"$address2\", city=\"$city\", state=\"$state\", zip=\"$zip\", country=\"$country\", email=\"$email\" WHERE email = \"$email\""; #actually execute the UPDATE $sth = $dbh->prepare($sql); $sth->execute(); # finish and disconnect $sth->finish(); $dbh->disconnect(); } # if there are no rows returned, it's a new record, so insert it else { ## Set sql to perfect insert format $sql = "insert into $table (prefix,firstname,middlename,lastname,address1,address2,city,state,zip,c ountry,email,phone,howfound,interest,lastpurch_web,optin,optin_partners, mail_type,comments,record_type,date,browser) VALUES (\"$prefix\",\"$firstname\",\"$middlename\",\"$lastname\",\"$address1\", \"$address2\",\"$city\",\"$state\",\"$zip\",\"$country\",\"$email\")"; #actually execute the insert $sth = $dbh->prepare($sql); $sth->execute(); # finish and disconnect $sth->finish(); $dbh->disconnect(); } providing the finest in midget technology - 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 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php