Re: unable call database
Here's what I use it should tell you exactly what your problem is: Also check out tutorial on http://www.porlmonks.org. -- David Jackson use DBI; use diagnostics; use strict; my ($dbh,$sth); my ($dbname)=dataase_name; my ($login)=login_name; my ($password) =your_pasword; my (@ary); # $dbh = DBI-connect(DBI:mysql:$dbname,$login,$password) or die Can't connect to $dbh: $dbh-errstr\n; $sth = $dbh-prepare(SELECT * FROM catalog) or die Can't connect to $dbh: $sth-errstr\n; $sth- execute() or die Can't connect to $dbh: $sth-errstr\n; $sth - finish(); $dbh-disconnect(); - 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: (WOT) Re: Perl problem
Here's what I use: use DBI; use diagnostics; use strict; my ($dbh,$sth); my ($dbname)=pickle; my ($login)=picklesql; my ($password) =pi56fb; my (@ary); # $dbh = DBI-connect(DBI:mysql:$dbname,$login,$password) or die Can't connect to $dbh: $dbh-errstr\n; $sth = $dbh-prepare(SELECT * FROM catalog) or die Can't connect to $dbh: $sth-errstr\n; $sth- execute() or die Can't connect to $dbh: $sth-errstr\n; $sth - finish(); $dbh-disconnect(); From the DBI manual: $dbh = DBI-connect($data_source, $username, $auth, \%attr); You're not telling DBI what the DSN is (Data source name) John Mayson wrote: I've decided to graduate to the next step and access my mySQL databases with Perl. I am attempting this on a Win2000 machine. Here's my code... #!C:/perl/bin/perl.exe -w use strict; use CGI qw(:standard); use DBI; my $dbh = DBI-connect('Radio', 'root', ''); I get this error message... Can't locate object method connect via package DBI (perhaps you forgot to load DBI?) at C:\Program Files\Apache Group\Apache2\cgi-bin\rdb.pl line 7. DBI.pm lives under c:\perl\lib which is in my @INC. Ideas? John -- John Mayson KC4VJO Linux/Perl/HP-UX/ICT Austin, Texas 78729 30.4560N 97.7851W [EMAIL PROTECTED] http://www.nyx.net/~jmayson - 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 -- Colin Faber (303) 859-1491 fpsn.net, Inc. - 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 - 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: Perl problem
Here's what I use (a little different): use DBI; use diagnostics; use strict; my ($dbh,$sth); my ($dbname)=pickle; my ($login)=picklesql; my ($password) =pi56fb; my (@ary); # $dbh = DBI-connect(DBI:mysql:$dbname,$login,$password) or die Can't connect to $dbh: $dbh-errstr\n; $sth = $dbh-prepare(SELECT * FROM catalog) or die Can't connect to $dbh: $sth-errstr\n; $sth- execute() or die Can't connect to $dbh: $sth-errstr\n; $sth - finish(); $dbh-disconnect(); The $dbh connect code should be like this: $dbh=DBI-connect(DBI:mysql:datrtabase=radio';host=localhost,root,passwor d, {RaiseError=1}); If there is an error, you can catch it using, die statement. Placed At : John Mayson [EMAIL PROTECTED] on 01/01/2002 08:24:50 AM Please respond to [EMAIL PROTECTED] To: MySQL List [EMAIL PROTECTED], Central Florida Geeks [EMAIL PROTECTED] cc:(bcc: Durga Prasad/Satyam) Subject: Perl problem I've decided to graduate to the next step and access my mySQL databases with Perl. I am attempting this on a Win2000 machine. Here's my code... #!C:/perl/bin/perl.exe -w use strict; use CGI qw(:standard); use DBI; my $dbh = DBI-connect('Radio', 'root', ''); I get this error message... Can't locate object method connect via package DBI (perhaps you forgot to load DBI?) at C:\Program Files\Apache Group\Apache2\cgi-bin\rdb.pl line 7. DBI.pm lives under c:\perl\lib which is in my @INC. Ideas? John -- John Mayson KC4VJO Linux/Perl/HP-UX/ICT Austin, Texas 78729 30.4560N 97.7851W [EMAIL PROTECTED] http://www.nyx.net/~jmayson - 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 - 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
List BUG? Unsuscribe info appaears in replies
database,mysql,sql ALL -- For reason unknown I seeing the unsubscribe information, for any email I read or reply, here's what I'm talking about: NOTE: I don't have this problem on the other list I subscribe to? Thanks, David 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 When I read mail I see: 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 - 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
Append queries
Is there a why to append a feild in mysql as apposed to updating? For event log table for a datacenter. Or is this something that would be better handled at the script level? Thanks David - 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: mysql start
Richard -- Did you set the --prefix=/usr/local/mysql when you ran config? If not Your bin are located in /usr/local/bin maybe /usr/local/sbin? The start script is saying the either the programs not ther or you have a permissions problem? Did you create user and group mysql, Install as above to /usr/local/mysql, and chown -R mysql:mysql mysql dir. Finally (for now) ls -l mysqld what are perms, run mysqld as stand alone. Hope this helps, David * BASIC DBD/DBI Connect Function: * /usr/local/bin/perl -w use strict; use diagnostics; use DBI; $dbh = DBI-connect(DBI:mysql:$dbname,$login,$password) or die Can't connect to $dbh: $dbh-errstr\n; $sth = $dbh-prepare(SELECT * FROM catalog) or die Can't connect to $dbh: $sth-errstr\n; $sth- execute() or die Can't connect to $dbh: $sth-errstr\n; $sth - finish(); $dbh-disconnect(); - 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: where
Julian -- There is the generic WHERE keyords ='%string%', but more to the point here the link to the docs for regrex goodies: http://www.mysql.com/doc/manual.php?search_query=regular+expressionsubmit=S earchdepth=0 David Hi, I have recently gained access to mysql (new isp), and am converting my old text databases to sql ones. I had a text database with a field 'keywords'. I have entered them as one field, What I want to do is submit a query where I can ask if this field CONTAINS rather than equals a string. Can you use regular expressions in this way? I want to have something like $result = mysql_query (SELECT title, keywords, description FROM documents WHERE keywords='$word'); but with keywords 'contains' '$word' a bit like keywords =~ m/$word/g in perl How would you all go about this? should I set my database up differently? Thanks very much! Jules - 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 -- * BASIC DBD/DBI Connect Function: * /usr/local/bin/perl -w use strict; use diagnostics; use DBI; $dbh = DBI-connect(DBI:mysql:$dbname,$login,$password) or die Can't connect to $dbh: $dbh-errstr\n; $sth = $dbh-prepare(SELECT * FROM catalog) or die Can't connect to $dbh: $sth-errstr\n; $sth- execute() or die Can't connect to $dbh: $sth-errstr\n; $sth - finish(); $dbh-disconnect(); - 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: Equivalent Query in MySQL
psm 996 -- The real question is: Does MySQL support sub query, the short answer is 3.x.x does not, 4.x.x is supposed to. The longer answer(and work arounds) to the 3.x.x question can be found here: http://www.mysql.com/doc/A/N/ANSI_diff_Sub-selects.html David * BASIC DBD/DBI Connect Function: * /usr/local/bin/perl -w use strict; use diagnostics; use DBI; $dbh = DBI-connect(DBI:mysql:$dbname,$login,$password) or die Can't connect to $dbh: $dbh-errstr\n; $sth = $dbh-prepare(SELECT * FROM catalog) or die Can't connect to $dbh: $sth-errstr\n; $sth- execute() or die Can't connect to $dbh: $sth-errstr\n; $sth - finish(); $dbh-disconnect(); - 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: Somewhat simple question on tables.
James -- You haven't done enough book work this is basic db design stuff, covered in Dubois book and evey other, the short answer is: Primary Key - foriegn Keys i.e People table: person_id, # Primary key, unique and auto increment fname lname ... Food person_id # pulled from People table via select statement # Index Not unique, NOT auto inecremented food_index # Primary key, unique and auto increment More important, How do you want to search this tables. i.e. first, last, food ..etc think indexing. Final thought, do you want to pull food names from anothe table? David Hello, I have a relatively simple question to ask. Any help is great appreciated. Let us say that I want to create a classic table that would have columns for a persons name, eye color, age, etc. However, I also want to store a list (somewhere) of that particular persons favorite foods (which can grow to be several hundred entries). I realize that there could be many ways of doing this, but what is the 'most effective' method? I have the DuBois mySQL book if anyone could cite any references. Thank you, Jim P.S. you're all doing great job with the development of mySQL. I tip my hat. - 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 - 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: Problem with LOAD DATA INFILE
Are you using mysqlimport utility? If not that may be you answer? If so what flags are you setting? david HI ALL: Happy New Year ;) I have a text file generated from MSAccess database, one of the fields (Long Text) have Carriage returns within the text, So the data of some records falls in more than one line in the text file, when I'm using the SQL statement LOAD DATA INFILE... I have only the first line of the data in this field, You know the data in the file looks like : 8|RO|The rates are applicabe for prepaid shipments only. Other charges: Awb fees 230Syp, Handling 0.65Syp per KG, Stamp 16Syp.|\r\n 9|KL|Other charges: Awb fees 230Syp, Handling 0.65Syp per KG, Stamp 16Syp, Security Charge 0.13Usd per Kg based on actual weight of the shipment.|\r\n 10|JU|Other charges: Awb fees 230Syp, Handling 0.65Syp per KG, Stamp 16Syp.|\r\n Please Help Best Regards Hayan Get your own 800 number Voicemail, fax, email, and a lot more http://www.ureach.com/reg/tag - 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 - 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: Access Denied
Clinton -- It's saying you password is incorrect or wasn't entered. I believe. Did you set username and password in script? Also http://www.perlmonks.org have some tutorials on DBI/DBD, you would find helpfull. -- david I get this error when trying to connect to a mysql database DBI-connect(database=baggs) failed: Access denied for user: 'baggs@localhost' (Using password: YES) I added the user 'baggs' to the user table and to the db privilege table and used mysqladmin reload to refresh the tables. Any Ideas. - 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 - 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: Backup Question.
Richard -- You could do both, I would be a lot quicker to import data than restore from tape. Say do an incremental dump back to your last level 0. Which would be helpfull to developers as well as youself. You could also use a seperate partition for the data directory and back that up. The subject of backups falls under the same catagory as: sport,relegion and politics isn't discussed in polite company. Have I confused you yet :) David I am running mysql on a linux box RH 6.2. I backup all the filesytems with: /sbin/dump 0ubf 800 /dev/npt0 to a COLORADO 8gig. travan tape drive. Is this sort of backup regimen a good one -- compatible with MySQL -- or should I instead be backing up with FLUSH and (or) mysqldump? Any help would be greatly appreciated. Richard - 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 - 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,sql my unscribe info appears in mail
database,sql,query,table Your message cannot be posted because it appears to be either spam or simply off topic to our filter. To bypass the filter you must include one of the following words in your message: database,sql,query,table If you just reply to this message, and include the entire text of it in the reply, your reply will go through. However, you should first review the text of the message to make sure it has something to do with MySQL. Just typing the word MySQL once will be sufficient, for example. You have written the following: Is it my mail program or the list program. But when I reply to mail MY unsubscribe information appears. David - 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: --- query to find records related tables with no match?
From page 165 MySQL (New Riders): LEFT JOIN: SELECT t1.* FROM t1 LEFT JOIN t2 ON t1.i1 = t2.i2 WHERE t2.i2 IS NULL -- david Ack - sorry - can someone remind me the SQL format for this? if you have a linked CLIENTS and INVOICES table... ...what's the query to find CLIENTS with NO INVOICES? (say 'clientid' is the name of the field in both clients and invoices table) I think it's some kind of join=NULL but I'm stuck. 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 - 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: php/mysql download
If you're looking for php. suft on over to the PHP homeworld: http://php.net current version is 4.1.1 David Does anyone have the location of a php-mysql-4.0.3 version that I could download? Tobe - 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 - 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: DBD::mysql HElp
Did you do install mysql or install DBD-mysql? Here's what the activestate page has to say: ActivePerl offers a PPM archive of DBD::mysql. All you need to do is typing ppm install DBI install DBD-mysql This will fetch the modules via HTTP and install them. If you need to use a WWW proxy server, the environment variable Now if you'll excuse me while i pull up my PHP soapbox. I find PHP a much more direct( and simpler) why to build dynamic web pages (if that's objective is?), and the user community *much* more helpful. http://php.net. As far as the Perl side goes: try the howto at http://perlmongs.org. -- David - 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