RE: SELECT w/LIKE on Swedish character ö finds ], why?
Ken, That worked! THanks very much. -Original Message- From: Ken Menzel [mailto:[EMAIL PROTECTED]] Sent: den 26 mars 2002 21:25 To: Philip Semanchuk Cc: [EMAIL PROTECTED] Subject: Re: SELECT w/LIKE on Swedish character ö finds ], why? Hi Philip, before running your test next time try this: vi /etc/my.cnf insert into this file: [mysqld] default-character-set = swe7 then stop mysql (mysqladmin shutdown) and restart (safe_mysqld) then try your test again. It worked fine for me. Ken Philip Semanchuk wrote: Hi everyone, I am having a little trouble with searching for Swedish characters. When I SELECT using LIKE I get matches that I do not expect. I have created a simple test case that is entirely reproduced below. To summarize, I insert one row into a single-column table that contains the right square bracket character (ASCII 0x5d). When I search for the Swedish letter ö (ISO-8859-1 0xf6) I find the row containing the right bracket. We're running RedHat 7.2 with nothing fancy added in as we're Linux novices and just playing around with the system to see how it works. MySQL -V produces this: mysql Ver 11.15 Distrib 3.23.41, for redhat-linux-gnu (i386) Here's my test: mysql create database swedish_character_test; Query OK, 1 row affected (0.00 sec) mysql use swedish_character_test; Database changed mysql create table simple (name varchar(255) NOT NULL); Query OK, 0 rows affected (0.00 sec) mysql insert into simple (name) values (']'); Query OK, 1 row affected (0.00 sec) mysql select name from simple where name like '%ö%'; +--+ | name | +--+ | ]| +--+ 1 row in set (0.00 sec) I'd appreciate any help understanding why ö = ] in this case. - 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: load data infile question
Hi, Harpreet: You should use MySQL C API mysql_escape_string(...) to convert that description field into a legal SQL string before load data infile. B.R. budingc - Original Message - From: Harpreet Kaur [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 4:41 AM Subject: load data infile question I want to transfer data from a table in sql server to mysql. I use C:\ BCP dbname.dbo.tblname out tblname.txt -S srvrname -U sa P sapwd -c -t \t -r \n to write the data to a text file and then use load data infile ?var/www/html/tblname.txt' into table tblname; It works fine for all the tables except this one table which has description field with several lines. It assumes each line as a seperate field rather then one field and so create errors. Please help. Regards Harpreet _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. - 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: Date Interval Grouping
~! Ok here's what I trying to do. I am trying to design a little browser/ip tracking page and I need an SQL statement that will allow me to group IPs that hit the site in 5 minute intervals (well I just want the interval thing to work cuz I'll prolly want to make this like 30 minutes or a full hour). The reason I want this kind of grouping is that if a person hits the page constantly for 5 minutes I don't want that to push other relevant IPs down the listing. Here's what I have to actually select the data from the database. SELECT tblVisitorHits.vIP, tblVisitorHits.vDateTime, tblBrowser.bVersion FROM tblBrowser RIGHT JOIN tblVisitorHits ON tblVisitorHits.vBrowser = tblBrowser.bKey ORDER BY tblVisitorHits.vDateTime DESC, tblBrowser.bVersion ASC LIMIT 0, 50; // A simple group by I know will not work. but was wondering if there // was a way to create a more complex group by that included expressions. I don't know how one would implement the interval grouping. Any help would be graciously accepted. How about using: expr BETWEEN min AND max? (sorry, online manual search function not working for me right now, please look it up for yourself) =dn - 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
permissions
Can anyone tell me how to grant connect to a database. I'm using MySql on an NT server. Most clients can connect to the database but one PC can't, that pc is running linux. Can anyone help? Thanks, Neil - 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
Large datafiles
Hi I'm running mysql 3.23.36 on a Red Hat 7.1 with the standard kernel. I have a /var partition (ext2) with 6.5 gb total space. One of the tables are almost running out of space, it is almost 4 gb. is it the filsystem that prevents files larger than 4 gb, or is it mysql that should be tweaked ? If i could use the last 2 gb on the partition, my problems would be solved for the next 4 months, any sugestions ? Im also considering installing a rh7.2 with the sgi xfs, anyone having any experiance with XFS ? -- Svend Erik Høst Jørgensen mailto:[EMAIL PROTECTED] Pallas Informatik A/S http://www.pallas.dk Allerød Stationsvej 2D Tel.: +45 48 10 24 10 DK-3450 Allerød Fax.: +45 48 10 24 01 - 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
Large datafiles
Svend, Wednesday, March 27, 2002, 12:30:28 PM, you wrote: SEHJ I'm running mysql 3.23.36 on a Red Hat 7.1 with the standard kernel. SEHJ I have a /var partition (ext2) with 6.5 gb total space. SEHJ One of the tables are almost running out of space, it is almost 4 gb. is it SEHJ the filsystem that prevents files larger than 4 gb, or is it mysql that SEHJ should be tweaked ? SEHJ If i could use the last 2 gb on the partition, my problems would be solved SEHJ for the next 4 months, any sugestions ? Do you use MyISAM tables? Maximum size of MyISAM table depends on your OS. By default MySQL tables have a maximum size of about 4G, but you can increase table size by editing AVG_ROW_LENGTH and MAX_ROWS when you CREATE or ALTER table. You can read more at: http://www.mysql.com/doc/T/a/Table_size.html -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - 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: upgrade 3.22 to 3.23 or 4.0 version
Hello Swapna, I'm trying to upgrade my MySQL 3.22 version to 3.23 or 4.0 version on Linux flatform, but I don't know the procedure. Could any one please tell me the procedure how to do it. And if I upgrade to the higher version do I lose any of my data. There are a lot of info about MySQL upgading in the manual. Please, check the following link: http://www.mysql.com/doc/U/p/Upgrade.html Before upgrading you can backup databases using mysqldump utility and then restore them. How to use mysqldump and mysqldump options you can find at: http://www.mysql.com/doc/m/y/mysqldump.html Thanks Swapna -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - 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
permissions
Neil, Wednesday, March 27, 2002, 12:12:37 PM, you wrote: ND Can anyone tell me how to grant connect to a database. I'm using MySql on an ND NT server. Most clients can connect to the database but one PC can't, that ND pc is running linux. Can anyone help? You should to allow your Linux box to connect to MySQL server. You can read more about MySQL privilege system at: http://www.mysql.com/doc/P/r/Privileges.html How to set up grants for user with comments and examples look at: http://www.mysql.com/doc/G/R/GRANT.html ND Thanks, ND Neil -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - 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
DRDB vs. MySQL replication
Hi, has anyone used DRDB (http://www.linbit.com/) instead of the standard MySQL replication? DRDB implements a virtual disk mirrored across a local disk and a disk in a remote stand-by server. On first thought, it adds some complexity to setup, but it can also replicate information not written to MySQL but e.g. directly to the filesystem. Any thoughts on this? Jens Vonderheide REDLINK Mediendienste GmbH http://www.redlink.de/ - 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
Excel to MySQL
How do i import MS Excel Data into MySQL Tables?? T. Edison jr. = Rahul S. Johari (Director) ** Abraxas Technologies Inc. Homepage : http://www.abraxastech.com Email : [EMAIL PROTECTED] Tel : 91-4546512/4522124 *** __ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/ - 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
auto_increment and range or highest value
Hi, I'am using autoincrement field with innodb table. (Mysql 3.23.47-log on Linux ppc) Two questions 1_ how to set a range ? Is the only solution chosing betwwen tinyint, smallint, ..., bigint I over words : I want a range from 1 to 999 for example , how can I do ? 2_ What's happens when the highest value is reached I have made a try with : create table Generator (Sequence smallint(7) zerofill unique primary key not null auto_increment ) type=innodb ; insert into Generator values(null); update Generator set Sequence=LAST_INSERT_ID(Sequence+1) ; Everything works fine, ok now what happens for the highest value ? update Generator set Sequence=65535 ; select * from Generator ; +--+ | Sequence | +--+ | 0065535 | +--+ update Generator set Sequence=LAST_INSERT_ID(Sequence+1) ; select * from Generator ; +--+ | Sequence | +--+ | 0065535 | +--+ Here something doesn't work, or I probably not undestood ! Thank you for any help -- Bernard CHAMBON IN2P3 / CNRS (Centre de Calcul de LYON) Tél : 04 72 69 42 18 http://www.in2p3.fr/CC - 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
RedHat6.2 and kernel 2.2.14
We've got a RedHat 6.2 system here, and every so often it fails to commit an INSERT to the database, (using BDB table type). Apart from that the system works fine. I was wondering if this is a symptom of the kernel 2.2.14 problem that's mentioned on the download page. Anyone got any views on this? Regards Bob Cross. (anti-spam filter bypass: sql query on table stored in mysql database) - 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
Large datafiles
Well, if i'm usin ext2 with a blocksize on 4 kb, then the largest file should be about 4 gb, right ? -Original Message- From: Egor Egorov [mailto:[EMAIL PROTECTED]] Sent: 27. marts 2002 12:16 To: [EMAIL PROTECTED] Subject: Large datafiles Svend, Wednesday, March 27, 2002, 12:30:28 PM, you wrote: SEHJ I'm running mysql 3.23.36 on a Red Hat 7.1 with the standard kernel. SEHJ I have a /var partition (ext2) with 6.5 gb total space. SEHJ One of the tables are almost running out of space, it is almost 4 gb. is it SEHJ the filsystem that prevents files larger than 4 gb, or is it mysql that SEHJ should be tweaked ? SEHJ If i could use the last 2 gb on the partition, my problems would be solved SEHJ for the next 4 months, any sugestions ? Do you use MyISAM tables? Maximum size of MyISAM table depends on your OS. By default MySQL tables have a maximum size of about 4G, but you can increase table size by editing AVG_ROW_LENGTH and MAX_ROWS when you CREATE or ALTER table. You can read more at: http://www.mysql.com/doc/T/a/Table_size.html -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - 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
last_insert_id() not replicated correctly (?)
Hi Guys, http://www.mysql.com/doc/R/e/Replication_Features.html ... states that last_insert_id() will be replicated correctly. However I don't think this is always the case, for instance: INSERT INTO TABLE tab1 (field1) values (Test); INSERT INTO TABLE tab2 (somefield) values (last_insert_id()); Will replicate properly *ONLY IF* tab1 is being replicated by the slave. If tab1 is not being replicated then the value inserted into somefield on tab2 will not match that on the server. This is with 3.23.47 at least. Is this a bug or simply that my definition of correctly does not match yours? :) Regards, Chris -- Chris Wilson [EMAIL PROTECTED] http://www.wapmx.com - 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
Help me!
My Server is Redhat 7.2 OS and MySQL Server. I've deleted the mysql system table in MySQL Server. I can't connect to MySQL Server from any Client. I would like to know the structure of it in order to recreate it. Help me, please! Thank you very much _ Chat with friends online, try MSN Messenger: http://messenger.msn.com - 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: mysqlgui crash caused by infinite loop
[EMAIL PROTECTED] writes: Description: mysqlgui crash caused by infinite loop in mysql_read_default_options because strcend never returns 0 How-To-Repeat: Fix: --- libmysql/libmysql.c.orig Thu Feb 14 18:30:17 2002 +++ libmysql/libmysql.c Tue Mar 19 15:52:49 2002 @@ -712,7 +712,7 @@ static void mysql_read_default_options(s *end=0; /* Remove '=' */ } /* Change all '_' in variable name to '-' */ - for (end= *option ; (end= strcend(end,'_')) ; ) + for (end= *option ; (end= strcend(end,'_')) *end; ) *end= '-'; switch (find_type(*option+2,option_types,2)) { case 1: /* port */ --- libmysql_r/libmysql.c.origThu Feb 14 18:30:17 2002 +++ libmysql_r/libmysql.c Tue Mar 26 22:52:17 2002 @@ -712,7 +712,7 @@ static void mysql_read_default_options(s *end=0; /* Remove '=' */ } /* Change all '_' in variable name to '-' */ - for (end= *option ; (end= strcend(end,'_')) ; ) + for (end= *option ; (end= strcend(end,'_')) *end; ) *end= '-'; switch (find_type(*option+2,option_types,2)) { case 1: /* port */ Hi! Thank you, both for your mail fix. This bug was fixed few weeks ago. Fixed version will be released both with 3.23.50 and 4.0.2. Thanks again. -- Regards, __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Mr. Sinisa Milivojevic [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus ___/ www.mysql.com - 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
Help me!
noat, Wednesday, March 27, 2002, 2:49:16 PM, you wrote: nnn My Server is Redhat 7.2 OS and MySQL Server. nnn I've deleted the mysql system table in MySQL Server. nnn I can't connect to MySQL Server from any Client. nnn I would like to know the structure of it in order to recreate it. You should take down MySQL server, move your 'mysql' database dir (if it exists) and then run mysql_install_db script to re-create grant tables. How to use mysql_install_db, look at: http://www.mysql.com/doc/m/y/mysql_install_db.html nnn Help me, please! nnn Thank you very much -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - 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
Replication Connection: Slave - Master?
We are looking at using replication between two MySQL servers. In our situation, there might be a firewall between the two servers and we will need to permit the traffic between the two through the firewall. From what I have read, it sounds like the Slave connects to the Master (in stead of the master to the slave, or even the slave contacting the master, and then the master establishing a connection to the slave). Is this (Slave - Master) correct? It also seems as if the data transfer happens on port 3306 (by default). THis is also correct? thanks benji --- Ben Spencer Web Support [EMAIL PROTECTED] x 2288 - 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: Excel to MySQL
At 3:58 -0800 3/27/02, Thomas Edison Jr. wrote: How do i import MS Excel Data into MySQL Tables?? One way: save it as a tab-delimited file, then import it with mysqlimport. If you don't want to mess around pointing and clicking to save an Excel file as a tab-delimited file, try using this Perl script: #! /usr/bin/perl -w # from_excel.pl - read Excel spreadsheet, write tab-delimited, # linefeed-terminated output to the standard output. use strict; use Spreadsheet::ParseExcel::Simple; @ARGV or die Usage: $0 excel-file\n; my $xls = Spreadsheet::ParseExcel::Simple-read ($ARGV[0]); foreach my $sheet ($xls-sheets ()) { while ($sheet-has_data ()) { my @data = $sheet-next_row (); print join (\t, @data) . \n; } } exit (0); Run it like this: from_excel.pl excel_file.xls excel_file.txt Spreadsheet::ParseExcel::Simple requires a few other modules that'll need to be installed first. T. Edison jr. = Rahul S. Johari (Director) ** Abraxas Technologies Inc. Homepage : http://www.abraxastech.com Email : [EMAIL PROTECTED] Tel : 91-4546512/4522124 *** - 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: Date Interval Grouping
try GROUP BY (UNIX_TIMESTAMP(tVH.vDateTime) - MOD(UNIX_TIMESTAMP(tVH.vDateTime, 300))) From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Date Interval Grouping Date: Tue, 26 Mar 2002 19:13:44 -0700 Ok here's what I trying to do. I am trying to design a little browser/ip tracking page and I need an SQL statement that will allow me to group IPs that hit the site in 5 minute intervals (well I just want the interval thing to work cuz I'll prolly want to make this like 30 minutes or a full hour). The reason I want this kind of grouping is that if a person hits the page constantly for 5 minutes I don't want that to push other relevant IPs down the listing. Here's what I have to actually select the data from the database. SELECT tblVisitorHits.vIP, tblVisitorHits.vDateTime, tblBrowser.bVersion FROM tblBrowser RIGHT JOIN tblVisitorHits ON tblVisitorHits.vBrowser = tblBrowser.bKey ORDER BY tblVisitorHits.vDateTime DESC, tblBrowser.bVersion ASC LIMIT 0, 50; // A simple group by I know will not work. but was wondering if there // was a way to create a more complex group by that included expressions. I don't know how one would implement the interval grouping. Any help would be graciously accepted. ~! - 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: Replication Connection: Slave - Master?
Oops meant to include the list on that one :) Begin forwarded message: Date: Wed, 27 Mar 2002 14:11:54 + From: Chris Wilson [EMAIL PROTECTED] To: Benji Spencer [EMAIL PROTECTED] Subject: Re: Replication Connection: Slave - Master? On Wed, 27 Mar 2002 07:21:11 -0600 Benji Spencer [EMAIL PROTECTED] wrote: We are looking at using replication between two MySQL servers. In our situation, there might be a firewall between the two servers and we will need to permit the traffic between the two through the firewall. From what I have read, it sounds like the Slave connects to the Master (in stead of the master to the slave, or even the slave contacting the master, and then the master establishing a connection to the slave). Is this (Slave - Master) correct? It also seems as if the data transfer happens on port 3306 (by default). THis is also correct? Yes the slave makes a connection to the master on port 3306 (by default - you can change this) - just like a regular [remote] mysql client. Unless you're using mysql 4.x with it's SSL support then bear in mind that all data is unencrypted so if you're going to send it over an insecure network you might want to pipe it down something like an SSH tunnel (you can then have SSH compress the stream too) or perhaps use something like CIPE (http://freshmeat.net/projects/cipe) to create a VPN between the slave and master systems. HTH Chris -- Chris Wilson [EMAIL PROTECTED] http://www.wapmx.com - 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: ASP and MySQL
Being in Italy, we use apostrophes in our fields constantly! MySQL itself has no problems with them at all. As you say, you're using ASP as your front end, and standard SQL statements to add, edit and delete records. For ASP I'm not sure, but in our PHP code it works to simply add a backslash before each apostrophe before using the string in the database. For SQL you may find that just using double quotes for all strings is sufficient to recognize the apostrophe as a regular character. Steve Rapaport CTO, A-Tono Via Amedei, 15 - Milano 20123 Cel.: +39 348 6431573 Fax : +1 617 687 0415 ] -Original Message- ] From: Loretta [mailto:[EMAIL PROTECTED]] ] Sent: Wednesday, March 27, 2002 6:54 AM ] To: [EMAIL PROTECTED] ] Subject: ASP and MySQL ] ] ] I am having a problem inserting names with apostrophes into the MySQL ] database. I am using ASP as my front end with standard SQL statements to ] add, edit and delete records. I read the section in the manual on escape ] characters and have played around with many different variations trying to ] get it to work with absolutely no luck. ] ] The statement I am currently using looks like this: ] lname = Replace(Request.Form(lname),','') ] ] I have tried using the backslash character and several variations of ] different numbers of apostrophes. ] ] I would appreciate any help as this is the last problem to be ] solved before ] the database is functional. The rest of the debugging has been completed. ] ] Thank-you in advance, ] Loretta ] ] ] - ] 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 on a Cobalt RaQ4
Hi Will MySQL run on a Cobalt RaQ4 server ? Denis Croombs - 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 on a Cobalt RaQ4
Yes, my hosting providers use raq servers and I have mysql databases on all of my domains -Original Message- From: Denis Croombs [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 27, 2002 8:30 AM To: Mysql (E-mail) Subject: MYSQL on a Cobalt RaQ4 Hi Will MySQL run on a Cobalt RaQ4 server ? Denis Croombs - 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: MYSQL on a Cobalt RaQ4
Hi Denis, According to its datasheet, the RaQ4 is a 450MHz Intel compatible machine running Linux 2.2 so I can't see any problems installing and running MySQL on it. Regards, Chris -Original Message- From: Denis Croombs [mailto:[EMAIL PROTECTED]] Sent: 27 March 2002 14:30 To: Mysql (E-mail) Subject: MYSQL on a Cobalt RaQ4 Hi Will MySQL run on a Cobalt RaQ4 server ? Denis Croombs - 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
Write query to text file
Hi everyone My problem is as follows. I need a c program to run a query on the mysql database and then write the results into a text file. I am running the mysql on a Linux machine. I am new to mysql and according to another source there is an example program in the mysql source code? I checked through everything but could not find it. Could anyone direct me to the file? I am also not a c programmer otherwise I would have done it myself. Thanks Isak - 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
deleting logfiles
Hi, I'm running RH Linux 7.0,and Mysql Version: 3.23.22-beta, and the mysqld.log grows very rapidly. Is there a way to turn it off ? Logrotation is not really an option in this case, the only possibilities are not logging or delete it every day. Any hints ? JvD,Netherlands - 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: Help me!
Did you try installing a new copy of MySQL and then simply copying the appropriate files from mysql/data/mysql over to your damaged installation? Just an idea. joe -Original Message- From: noat naut - nart [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 27, 2002 5:49 AM To: [EMAIL PROTECTED] Subject: Help me! My Server is Redhat 7.2 OS and MySQL Server. I've deleted the mysql system table in MySQL Server. I can't connect to MySQL Server from any Client. I would like to know the structure of it in order to recreate it. Help me, please! Thank you very much _ Chat with friends online, try MSN Messenger: http://messenger.msn.com - 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: Write query to text file
Hi, RTFM see at INTO OUTFILE Adib. Isak Badenhorst wrote: Hi everyone My problem is as follows. I need a c program to run a query on the mysql database and then write the results into a text file. I am running the mysql on a Linux machine. I am new to mysql and according to another source there is an example program in the mysql source code? I checked through everything but could not find it. Could anyone direct me to the file? I am also not a c programmer otherwise I would have done it myself. Thanks Isak - 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
Write query to text file
Isak, Wednesday, March 27, 2002, 4:49:01 PM, you wrote: IB My problem is as follows. I need a c program to run a query on the mysql IB database and then write the results into a text file. I am running the IB mysql on a Linux machine. IB I am new to mysql and according to another source there is an example IB program in the mysql source code? I checked through everything but could IB not find it. IB Could anyone direct me to the file? I am also not a c programmer otherwise IB I would have done it myself. Look at SELECT INTO OUTFILE statement, this seems to be useful for you: http://www.mysql.com/doc/S/E/SELECT.html IB Thanks IB Isak -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - 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: [Newbie] MATCH and INDEX question (using a JOIN in a MATCH statement)
Thanks Paul, I figured that was the answer. Do I need to perform a second and third query from my related tables with a join back to the 'main' table? Example: select main.id, main.description, maincat.name, subcat.name from main LEFT JOIN maincat ON main.maincatid=maincat.id LEFT JOIN subcat ON main.subcatid=subcat.id WHERE MATCH (name) AGAINST ('keywords') WHERE MATCH (description, etc, etc2, etc3 ) AGAINST ('keywords') select main.id, main.description, maincat.name, subcat.name from maincat LEFT JOIN main ON maincat.id=main.maincat LEFT JOIN subcat ON subcat.id =main.subcatid WHERE MATCH (name) AGAINST ('keywords') select main.id, main.description, maincat.name, subcat.name from subcat LEFT JOIN main ON subcat.id=main.subcat LEFT JOIN maincat ON maincat.id =main.maincatid WHERE MATCH (name) AGAINST ('keywords') I would then have 3 arrays that I could join and sort and use as my results. I am not sure if this is more work than it is worth. I don't want to duplicate data but I am thinking of just adding a 'maincatname' and 'subcatname' columns to my 'main' table and update them from the related tables. Thanks for your help, Dan At 13:43 -0700 3/26/02, Dan Tappin wrote: This is a follow-up to a MySQL keyword text search question I had answer a few days ago. I have table 'main' which has two INT columns 'maincat' and 'subcat' which hold an index number from to other tables maincat and subcat. These table each hold descriptive names ('name') for each of the main categories and sub categories. I have no problem using MATCH to search the various fields of 'main' using an INDEX. The problem is I want to create a search across the related 'name' fields of the other two tables. Here is what I have so far: select main.id, description, maincat.name, subcat.name from main LEFT JOIN clients ON forsale.clientid=clients.id WHERE MATCH (description) AGAINST ('keywords') This works but I can only MATCH in the columns of 'main'. Now my first thought was to try this: select main.id, description, maincat.name, subcat.name from main LEFT JOIN clients ON forsale.clientid=clients.id WHERE MATCH (description, maincat.name, subcat.name) AGAINST ('keywords') Which results in an error. Can anyone tell me if I can do this using MATCH? Nope. The columns named in the MATCH() must match the columns for a FULLTEXT index, and indexes don't cross tables. Thanks, Dan - 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
Select data from local database into another host over
Does anybody have an idea how to select data from a local database into another host server ? For information, I'm currently using mySQL 3.23. Eric Huwaert Kind regards - Bien cordialement - Vriendelijke groeten - Mit freundlichen Grüßen , - 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: Large datafiles
At 04:30 AM 3/27/2002, you wrote: Hi I'm running mysql 3.23.36 on a Red Hat 7.1 with the standard kernel. I have a /var partition (ext2) with 6.5 gb total space. One of the tables are almost running out of space, it is almost 4 gb. is it the filsystem that prevents files larger than 4 gb, or is it mysql that should be tweaked ? If i could use the last 2 gb on the partition, my problems would be solved for the next 4 months, any sugestions ? Im also considering installing a rh7.2 with the sgi xfs, anyone having any experiance with XFS ? -- Svend, You could switch to InnoDb table type. InnoDb allows you to allocate multiple file spaces. So each file space is between 10M - 4g and you can have several of these. All of the Innodb tables are stored in this file space, the only separate files are *.frm files. InnoDb will load data considerably slower than MyISAM tables, but it will stand up much better to multi-user access. You may want to experiment with InnoDb to see if it solves your problem. http://www.innodb.com/features.html Brent _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com - 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: binary expansion?
I don't like the set type as I can't use it on other databases (even though I do not foresee changing databases, I like to keep the option open). The bit method is what I'll probably use. Thanks for the help :-) -Original Message- From: Joel Rees [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 27, 2002 1:05 AM To: adam nelson Cc: [EMAIL PROTECTED] Subject: Re: binary expansion? adam nelson queried: iPersonType is a list in the form of 1,2,4,8,16,32,64 so, let's suppose that szPersonType for 8 is lawyer and szPerson type for 2 is redhead a value of iPersonType of 10 would mean redhead lawyer. I'd like a query that looks for lawyers (ie. iPerson type is any number from 8 to 15 or 16+8=32 or 16+8+4=28 or 16+8+1=29 or 16+8+4+2=30 or 32+8=40 or 32+8+4=44 ,etc. up to the max(iPersonType)) If you don't like bit functions (manual section 6.3.5.1) you can always divide by the iPersonType and take modulus 2. A result of 1 says it's a hit, 0 says it's a miss. Incidentally, have you considered using a SET type here (manual section 6.2.3.4)? Joel Rees Alps Giken Kansai Systems Develoment Suita, Osaka - 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
How to use SSL on Win2000 client?
We have Solaris 2.8 running Mysql 3.23.49. We are building a database with an Access 2002 front end on Win98/95 or Win2000, which would run over the internet. My problem is, how do we encrypt the communications between the front-end and the back-end (mysql)? Mysql supports SSl but Access does not. However, Win2000 supports IPSec, and it appears Solaris has a command called ipsec. Does anyone know how to set these up? And how can I verify the communications are being encrypted? I have a sniffer from Analogx.com. And now for the curveball. Our customers will not have Win2000, but will have Win98/95. What are my client options for Win95/98? Thanks. p.s. I'm open to any other encryption options which are set up once, then you forget about it. I've heard about using a Virtual Private Network and maybe ipsec, which is supported both in Win2000 and Solaris 2.8. - 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
Calling SQL gurus
Hello SQL Gurus I am trying to write an sql statement that will return a row which contains vendor info, how much he owes, total payments and balance due. The results should look like this : ABC,VENDOR ONE,333.33,199.98,133.35 DEF,VENDOR TWO,333.33, 0.00,333.33 The statement uses 3 tables and contains following data VENDORS \\ CREATE TABLE vendor ( vendorno varchar(10) NOT NULL, vendorname varchar(30) NOT NULL ); INSERT INTO vendor VALUES( 'ABC', 'VENDOR ABC'); INSERT INTO vendor VALUES( 'DEF', 'VENDOR DEF'); INVOICES \\ CREATE TABLE invoices ( vendorno varchar(10) NOT NULL, invdate date DEFAULT '-00-00' NOT NULL, invoiceno varchar(10) NOT NULL, total decimal(10,2) DEFAULT '0.00' NOT NULL ); INSERT INTO invoices VALUES( 'ABC', '2002-02-01', '101', '111.11'); INSERT INTO invoices VALUES( 'ABC', '2002-02-02', '102', '222.22'); INSERT INTO invoices VALUES( 'DEF', '2002-02-02', '103', '333.33'); PAYMENTS \\ CREATE TABLE payments ( vendorno varchar(10) NOT NULL, paydate date DEFAULT '-00-00' NOT NULL, invoiceno varchar(10) NOT NULL, paid decimal(10,2) DEFAULT '0.00' NOT NULL ); INSERT INTO payments VALUES( 'ABC', '2002-03-01', '101', '55.55'); INSERT INTO payments VALUES( 'ABC', '2002-03-03', '102', '66.66'); INSERT INTO payments VALUES( 'ABC', '2002-03-04', '102', '77.77'); /// DETAILED SQL STATEMENT \ I have tried this statement which returns a detailed listing but what I want is a summarized listing select vendor.vendorno,vendor.vendorname,invoices.total, (payments.paid) , (invoices.total-payments.paid) as balance from vendor LEFT JOIN invoices on (vendor.vendorno=invoices.vendorno) LEFT JOIN payments on (vendor.vendorno=payments.vendorno) and (invoices.invoiceno=payments.invoiceno) order by vendor.vendorno // SUMMARIZED STATEMENT \ This summarized listing returns duplicate values for total and balance. select vendor.vendorno,vendor.vendorname,sum(invoices.total), sum(payments.paid) , sum(invoices.total-payments.paid) as balance from vendor LEFT JOIN invoices on (vendor.vendorno=invoices.vendorno) LEFT JOIN payments on (vendor.vendorno=payments.vendorno) and (invoices.invoiceno=payments.invoiceno) group by vendor.vendorno Am using Mysql 3.23.47 NT - 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: html to perl to mysql
Using apache 1.3.23 for win32 WinXp and Perl 5.6 and Mysql 3.23.44-nt The localhost test page by apache runs correctly The perl script runs from the command line, the Browser url line and just by clicking it in the dir. Trying to launch this perl-dbi script from the browser, all it does is insert data into an Mysql table by taking values from the html customer page. I used form method=post and action=myperlscript The browser displays a new page which displays the perl source code. Something else could be wrong, but this is usually an indicator your Content-type is incorrect. Your header should be Content-type: text/html -Lance - 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: Write query to text file
Thanks That was all I needed. Just a push in the right direction. Your friendliness was must appreciated. Isak -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 27 March 2002 17:01 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Write query to text file Hi, RTFM see at INTO OUTFILE Adib. Isak Badenhorst wrote: Hi everyone My problem is as follows. I need a c program to run a query on the mysql database and then write the results into a text file. I am running the mysql on a Linux machine. I am new to mysql and according to another source there is an example program in the mysql source code? I checked through everything but could not find it. Could anyone direct me to the file? I am also not a c programmer otherwise I would have done it myself. Thanks Isak - 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
Fetching Data based on the day
Hello everyone. I am trying to extract the data from MySQL based on the month, and day of the item, and post them on a page. Something similar to Today in History Here is a partial list of my table: CREATE TABLE ANNOUNCEMENT ( AnnouncementID bigint(20) unsigned DEFAULT '0' NOT NULL, Title varchar(250), DateShown date DEFAULT '-00-00' NOT NULL KEY AnnouncementID (AnnouncementID), KEY ID (AnnouncementID) ); Can anyone please tell me what I need to do? Here is what I have so far: SELECT AnnouncementID,Title,DateShown FROM ANNOUNCEMENT WHERE DateShown=NOW() ORDER BY DateShown DESC The problem is that it matches the list to the entire date (including the year), but I only want to look at the month, and the day, when fetching the data. Thanks so much. - 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: Fetching Data based on the day
From: Soheil Shaghaghi [EMAIL PROTECTED] SELECT AnnouncementID,Title,DateShown FROM ANNOUNCEMENT WHERE DateShown=NOW() ORDER BY DateShown DESC ...I only want to look at the month, and the day SELECT AnnouncementID,Title,DateShown FROM ANNOUNCEMENT WHERE substring(DateShown,6,5) = substring(NOW(),6,5) ORDER BY DateShown DESC Try these for an explination: select substring('2001-02-03 04:05:06', 6,5) as mon_day, substring('2001-02-03 04:05:06', 6,2) as mon, substring('2001-02-03 04:05:06', 9,2) as day; select substring(now(), 6,5) as mon_day, substring(now(), 6,2) as mon, substring(now(), 9,2) as day; --- Rodney Broom Programmer: Desert.Net sql - 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
Fetching Data based on the day
Soheil, Wednesday, March 27, 2002, 6:45:38 PM, you wrote: SS I am trying to extract the data from MySQL based on the month, and day of SS the item, and post them on a page. SS Something similar to Today in History SS Here is a partial list of my table: SS CREATE TABLE ANNOUNCEMENT ( SS AnnouncementID bigint(20) unsigned DEFAULT '0' NOT NULL, SS Title varchar(250), SS DateShown date DEFAULT '-00-00' NOT NULL SS KEY AnnouncementID (AnnouncementID), SS KEY ID (AnnouncementID) SS ); SS Can anyone please tell me what I need to do? SS Here is what I have so far: SS SELECT AnnouncementID,Title,DateShown FROM ANNOUNCEMENT WHERE SS DateShown=NOW() ORDER BY DateShown DESC SS The problem is that it matches the list to the entire date (including the SS year), but I only want to look at the month, and the day, when fetching the SS data. Look at the date and time functions, such as DAYOFMONTH(), YEAR() and so on: http://www.mysql.com/doc/D/a/Date_and_time_functions.html SS Thanks so much. -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - 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: [OT] html to perl to mysql
From: Bob T [EMAIL PROTECTED] The browser displays a new page which displays the perl source code. How do I run the perl script from the browser This means that Apache isn't executing your code, instead he's just reading in the text of myperlscript and sending it to the browser. You need to tell Apache to execute this script. Try adding something like this to your Apache config: AddHandler cgi-script .cgi This assumes that your script is actually called myperlscript.cgi. You'll also have to make sure that the file is formatted properly. For instance, your MS Windows might want the shebang at the top to look a certain way, maybe like this: #! perl --- Rodney Broom Programmer: Desert.Net sql - 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: Replication Failure (or Bug?): Cannot Connect, but Should?
Sorry to bring this up again, but I haven't received any helpful responses. Does anyone have any clues about this or is this something I should report as a bug? I can't imagine it is. Thank you, Leonard At 12:43 AM 3/26/2002 -0800, you wrote: Hello, I have been attempting to get replication working for a week now and am having little luck. I have followed the instructions in the documentation but get the following errors in the error log on the slave server: 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec Here are the relevant lines from my configuration files Master my.cnf: [mysqld] socket=/var/lib/mysql/mysql.sock log-bin server-id=1 Slave my.cnf: [mysqld] socket=/var/lib/mysql/mysql.sock master-host=10.0.0.10 master-user=repl master-password=password master-connect-retry=10 master-port=3306 server-id=2 I created the repl account on the master and have tried giving it FILE privileges and ALL PRIVILEGES on '%', '10.0.0.10' and the hostname of the slave server. The thing that stands out most for me about the error messages is that it says Can't connect to MySQL server on '0' when I have clearly entered the IP address, and that it says retrying in 0 seconds when I made the timeout 10 seconds. The MySQL version on the master server is 3.23.35 and the slave version is at 3.23.32. Any help would be greatly appreciated. Thanks, Leonard P.S. sql query - 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: Replication Failure (or Bug?): Cannot Connect, but Should?
Leonard, This is pretty clearly (IMHO) a permissions issue. Make sure the username you use to replicate with, has a '%' in the Host field of the user table. mysql use mysql mysql select * from user where user = 'your_replication_user' \G *** 1. row *** Host: % User: your_replication_user Password: encrypted_password Select_priv: N Insert_priv: N Update_priv: N Delete_priv: N Create_priv: N Drop_priv: N Reload_priv: N Shutdown_priv: N Process_priv: N File_priv: Y Grant_priv: N References_priv: N Index_priv: N Alter_priv: N 1 row in set (0.01 sec) Scott Helms Director of Technology, ZCorum - Original Message - From: Leonard Megliola [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 12:16 PM Subject: Re: Replication Failure (or Bug?): Cannot Connect, but Should? Sorry to bring this up again, but I haven't received any helpful responses. Does anyone have any clues about this or is this something I should report as a bug? I can't imagine it is. Thank you, Leonard At 12:43 AM 3/26/2002 -0800, you wrote: Hello, I have been attempting to get replication working for a week now and am having little luck. I have followed the instructions in the documentation but get the following errors in the error log on the slave server: 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec Here are the relevant lines from my configuration files Master my.cnf: [mysqld] socket=/var/lib/mysql/mysql.sock log-bin server-id=1 Slave my.cnf: [mysqld] socket=/var/lib/mysql/mysql.sock master-host=10.0.0.10 master-user=repl master-password=password master-connect-retry=10 master-port=3306 server-id=2 I created the repl account on the master and have tried giving it FILE privileges and ALL PRIVILEGES on '%', '10.0.0.10' and the hostname of the slave server. The thing that stands out most for me about the error messages is that it says Can't connect to MySQL server on '0' when I have clearly entered the IP address, and that it says retrying in 0 seconds when I made the timeout 10 seconds. The MySQL version on the master server is 3.23.35 and the slave version is at 3.23.32. Any help would be greatly appreciated. Thanks, Leonard P.S. sql query - 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 - 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: Adding a Column to an existing table
--- Steven Gearhart [EMAIL PROTECTED] wrote: The easiest way to add a column is to get somebody else to do it. Seriously, Use the ALTER TABLE TableName ADD COLUMN Company_id INT UNSIGNED NULL command. Yes. But also, the company_id field probably should be reset 'not null' AFTER the new column has been populated with your favorite id type/sequence. J.C. This syntax may be found in the MySQL manual in 6.5.4 http://www.mysql.com/doc/A/L/ALTER_TABLE.html ,or page 428 if you have downloaded the pdf version. I hope I have been of help. - Steve G. -Original Message- From: Ulrik Witschass [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 3:33 PM To: [EMAIL PROTECTED] Subject: Adding a Column to an existing table Hi, I'm new to this list, hopefully, I can contribute some wisdom :) At the moment, I have to update a large database to be multi-company-ready, so I basically have to add a Column Company_ID to nearly each table. What would be the easiest way to do this? I already thought about running a SELECT * Query for each table, saving the result in an Array (in PHP, btw, it's a webapplication), dropping the table, creating the new table and looping through the data to insert the data again. Problem is, that this puts a heavy task on the server, I tried it on a local crash-server, and even with carefully planned setting and unsetting of the arrays, it eats up the RAM since the arrays just get damn big. And since I have to remote control the server and it is important that the server is online nearly 24/7, I risk to crash the server without having the physical option to reboot it until the next morning...a few hundred kilometres away from my workplace... Now I am looking into two things: 1) is there some kind of MODIFY query I can run??? 2) or is it possible to dumb the database, drop it, create the new structure and then write the dumb back in with some options that it ignores the CREATE TABLE queries and that it doesn't check if the count of the values matches the count of the columns? (error I get when I try to do it at the moment). 3) another way... As you can see, I am not THAT experienced with MySQL, so any help is greatly appreciated!!! Ulrik __ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/ - 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: Replication Failure (or Bug?): Cannot Connect, but Should?
Hrm, I'll take a stab at it, since I've got replication working atm... Have you tried basic connectivity tests between the slave and master? ( Just making sure.. ie - can you telnet to port 3306 on the master, from the slave? ) Did you flush the privileges after adding the repl user? Here's my master my.cnf - [mysqld] port= 3306 socket = /tmp/mysql.sock skip-locking skip-innodb set-variable= key_buffer=16M set-variable= max_allowed_packet=1M set-variable= table_cache=64 set-variable= sort_buffer=512K set-variable= net_buffer_length=8K set-variable= myisam_sort_buffer_size=8M log-bin server-id = 1 And slave my.cnf - [mysqld] port= 3306 socket = /tmp/mysql.sock skip-locking skip-innodb set-variable= key_buffer=16M set-variable= max_allowed_packet=1M set-variable= table_cache=64 set-variable= sort_buffer=512K set-variable= net_buffer_length=8K set-variable= myisam_sort_buffer_size=8M log-bin server-id = 2 master-host=db.mine.com master-user=bkup master-password=password master-port=3306 Can you copy and paste your whole my.cnf from the slave? It doesn't sound like it's reading it correctly ( maybe why it's keeping the timeout at 0 and trying to connect to the wrong ip? ) -- sh On Wed, 2002-03-27 at 09:16, Leonard Megliola wrote: Sorry to bring this up again, but I haven't received any helpful responses. Does anyone have any clues about this or is this something I should report as a bug? I can't imagine it is. Thank you, Leonard At 12:43 AM 3/26/2002 -0800, you wrote: Hello, I have been attempting to get replication working for a week now and am having little luck. I have followed the instructions in the documentation but get the following errors in the error log on the slave server: 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec Here are the relevant lines from my configuration files Master my.cnf: [mysqld] socket=/var/lib/mysql/mysql.sock log-bin server-id=1 Slave my.cnf: [mysqld] socket=/var/lib/mysql/mysql.sock master-host=10.0.0.10 master-user=repl master-password=password master-connect-retry=10 master-port=3306 server-id=2 I created the repl account on the master and have tried giving it FILE privileges and ALL PRIVILEGES on '%', '10.0.0.10' and the hostname of the slave server. The thing that stands out most for me about the error messages is that it says Can't connect to MySQL server on '0' when I have clearly entered the IP address, and that it says retrying in 0 seconds when I made the timeout 10 seconds. The MySQL version on the master server is 3.23.35 and the slave version is at 3.23.32. Any help would be greatly appreciated. Thanks, Leonard P.S. sql query - 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 - 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
How can I Sort by Relevance?
I have a query like this select * from PROFILES where UCASE(DESCRIPTION) like '%A%' the result of this will be a set in which any member contains at least an A, but I'd like to sort them so as the result set becomes like this first: A second: AAA third: any string containing an A and so on I´d like to display results this way , in this case the first data is much relevant than the third one. But in the practise i get all results mixed up i will appreciate any help thanx - 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: How can I Sort by Relevance?
Walter Try adding to your select statement: ORDER BY DESCRIPTION ASC David -Original Message- From: Walter D. Funk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 27, 2002 11:05 AM To: [EMAIL PROTECTED] Subject: How can I Sort by Relevance? I have a query like this select * from PROFILES where UCASE(DESCRIPTION) like '%A%' the result of this will be a set in which any member contains at least an A, but I'd like to sort them so as the result set becomes like this first: A second: AAA third: any string containing an A and so on I´d like to display results this way , in this case the first data is much relevant than the third one. But in the practise i get all results mixed up i will appreciate any help thanx - 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: How can I Sort by Relevance?
At 15:05 -0300 3/27/02, Walter D. Funk wrote: I have a query like this select * from PROFILES where UCASE(DESCRIPTION) like '%A%' the result of this will be a set in which any member contains at least an A, but I'd like to sort them so as the result set becomes like this first: A second: AAA third: any string containing an A and so on I´d like to display results this way , in this case the first data is much relevant than the third one. But in the practise i get all results mixed up i will appreciate any help thanx LIKE evaluates to true or false, it doesn't return a relevance ranking. You could play tricks with an expression in an ORDER BY clause, but it's bound to be ugly. - 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: How can I Sort by Relevance?
From: Walter D. Funk [EMAIL PROTECTED] ...I'd like to sort them so as the result set becomes like this What language, if any, are you working in, other than SQL? --- Rodney Broom Programmer: Desert.Net - 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 on a Cobalt RaQ4
I have a Raq4 running with MySQL + php no problem. Save yourself a great deal of time by loading the packages available from: http://pkgmaster.com/ These Cobalt support team guys maintain security update and misc. packages which, for the Raq 3 and above, happen to include PHP and MySQL. I highly suggest loading these packages from the control panel instead of doing source installations. -Original Message- From: Denis Croombs [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 27, 2002 6:30 AM To: Mysql (E-mail) Subject: MYSQL on a Cobalt RaQ4 Hi Will MySQL run on a Cobalt RaQ4 server ? Denis Croombs - 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: hierarchical struture into mysql
Try looking up the Nested Set Hierarchy structure, which is mainly discussed by Joe Celko. There are a number of discussions on usenet (groups.google.com) about it, by him. Also, here's a URL which gives his description. It's a good structure, and with modification, looks like it can fit about any hierarchy you've got. http://searchdatabase.techtarget.com/tip/1,289483,sid13_gci537290,00.html?Fr omTaxonomy=%2Fpr%2F282457 Kevin Fries -Original Message- From: David yahoo [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 3:39 PM To: [EMAIL PROTECTED] Subject: hierarchical struture into mysql Hi all, I m looking for a tree struture for which can be easilly queried with mysql features. I only know the tree with row having a parent id. Retieving children can only be done with recursive : mysql doesnt do that ? Thanks _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com - 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
Replication failed: TRUNCATE TABLE command
Anti-SPAM: mysql, query Gurus I'm new to replication. Set it up this weekend and has worked flawlessly for several days. Then I used the command: TRUNCATE TABLE tbl; That worked in master, but was not replicated in slave. No mention of this in manual. Using version 3.23.49 on master and slave. Master is Solaris and slave is NT. The truncate command is much, much faster than DELETE FROM tbl; I can see why some clever person invented it. BTW, no mention of any problems in ref. manual or books. Any thoughts? David --- David E Lopez Org: SPS-ASP-SOC ATIC-CSAM Phone: 480-413-6251 email: [EMAIL PROTECTED] - 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: Enforcing Column Types
I have a column that is VARCHAR(32). I use it to store MD5 hash values. MD5 hashes are always 32 byte. So use char(32) instead. I do. -Original Message- From: Joel Rees [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 11:30 PM To: Tino Didriksen Cc: [EMAIL PROTECTED] Subject: Re: Enforcing Column Types Tino Didriksen queried: I have a column that is VARCHAR(32). I use it to store MD5 hash values. MD5 hashes are always 32 byte. In other words, that's 1 byte wasted because it's VARCHAR. With 2500 entries and more on the way, that's at least 2500 byte wasted. 2500 bytes out of 82,500? Three percent. How valuable is that 3%? How does it balance with other wasted space in the table? Total space? Is there no way to enforce a column type around the silent changes? You do understand the trade-offs involved in allowing variable length records in a database? that the database software has to either allocate the maximum width for each variable length field, or use an additional level of indirection in the indexing? Just a thought. Joel Rees Alps Giken Kansai Systems Develoment Suita, Osaka Filter fodder: sql,query (I thought the filter also accepted "database" and various sql commands, MySQL data types and things? Has the filter gone strict on us?) - 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: How can I Sort by Relevance?
Just an aside, the like comparison is case insensitive -- so you don't need the UCASE in this example. like '%A%' will match both A and a. --jeff - Original Message - From: Walter D. Funk [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 10:05 AM Subject: How can I Sort by Relevance? I have a query like this select * from PROFILES where UCASE(DESCRIPTION) like '%A%' the result of this will be a set in which any member contains at least an A, but I'd like to sort them so as the result set becomes like this first: A second: AAA third: any string containing an A and so on I´d like to display results this way , in this case the first data is much relevant than the third one. But in the practise i get all results mixed up i will appreciate any help thanx - 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: Select data from local database into another host over
4.8.5 mysqldump, Dumping Table Structure and Data Utility to dump a database or a collection of database for backup or for transferring the data to another SQL server (not necessarily a MySQL server). The dump will contain SQL statements to create the table and/or populate the table. If you are doing a backup on the server, you should consider using the mysqlhotcopy instead. See section 4.8.6 mysqlhotcopy, Copying MySQL Databases and Tables. ... However, it's also very useful to populate another MySQL server with information from a database: mysqldump --opt database | mysql --host=remote-host -C database http://www.mysql.com/doc/m/y/mysqldump.html C:~ -Original Message- From: erich [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 27, 2002 7:22 AM To: [EMAIL PROTECTED] Subject: Select data from local database into another host over Does anybody have an idea how to select data from a local database into another host server ? For information, I'm currently using mySQL 3.23. Eric Huwaert Kind regards - Bien cordialement - Vriendelijke groeten - Mit freundlichen Grüßen , - 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
What is wrong in this query???
Can someone tellme the problem in this query?? Is there any problem updating two tables in the same query??? update alumno, alumnocurso set alumno.nombre='Blas', alumno.apellidos='Martinez Maertinez', alumno.nacimiento='1990-09-12', alumno.telefono = '6', alumnocurso.incorporacion = '2002-3-16', alumnocurso.finalizacion='-0-0', alumnocurso.observaciones = 'Observaciones id 4' where alumno.id = '4' and alumnocurso.id = '4' and alumno.id = alumnocurso.id_alumno ; - 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: What is wrong in this query???
At 21:03 +0100 3/27/02, Javier Armendáriz wrote: Can someone tellme the problem in this query?? Is there any problem updating two tables in the same query??? Do you find that syntax to be allowed anywhere in the MySQL manual? There is work on this kind of thing being done for MySQL 4.1. It's not ready yet. update alumno, alumnocurso set alumno.nombre='Blas', alumno.apellidos='Martinez Maertinez', alumno.nacimiento='1990-09-12', alumno.telefono = '6', alumnocurso.incorporacion = '2002-3-16', alumnocurso.finalizacion='-0-0', alumnocurso.observaciones = 'Observaciones id 4' where alumno.id = '4' and alumnocurso.id = '4' and alumno.id = alumnocurso.id_alumno ; - 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: What is wrong in this query???
You cannot update multiple tables in a single UPDATE. Did you read the manual? -Original Message- From: Javier Armendáriz [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 27, 2002 2:04 PM To: MySQL Subject: What is wrong in this query??? Can someone tellme the problem in this query?? Is there any problem updating two tables in the same query??? update alumno, alumnocurso set alumno.nombre='Blas', alumno.apellidos='Martinez Maertinez', alumno.nacimiento='1990-09-12', alumno.telefono = '6', alumnocurso.incorporacion = '2002-3-16', alumnocurso.finalizacion='-0-0', alumnocurso.observaciones = 'Observaciones id 4' where alumno.id = '4' and alumnocurso.id = '4' and alumno.id = alumnocurso.id_alumno ; - 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: cipher strings usable under GRANT command
sql,query What are all the cipher strings possible using the GRANT command and the CIPHER clause? The docs only give one example. - 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
sum of a column
Hi all How do I get the sum of all values in a column 'col' of a table 'tab' I am using CGI-Perl and mysql. Thank you. Aman _ Send and receive Hotmail on your mobile device: http://mobile.msn.com - 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: sum of a column
select sum(col) from tab; On Wed, 2002-03-27 at 13:32, Aman Raheja wrote: Hi all How do I get the sum of all values in a column 'col' of a table 'tab' I am using CGI-Perl and mysql. Thank you. Aman _ Send and receive Hotmail on your mobile device: http://mobile.msn.com - 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
addition problem
I hope that someone can help me with this. I understood that if I do an update on a row in a table, I could use the SET row=row+1 and that would take what was in that row/column and add a 1 to it. For some reason, it is doubling it. My end result is always twice what it should be. Can anybody explain what I am doing wrong? I have a MySQL Update statement like the following. The variables will either be a 1 (one) or a 0 (zero). -- UPDATE $d SET w = w+$win, l = l+$loss, t = t+$tie, pts = pts+$pts, max_pt = max_pt+$max_pt where team_id = '$team_id' and sea_id = '$sea_id'; -- I even put the following line in right before the UPDATE to make sure that it was putting it in only once so that I could get a printout (I am using PHP): echo team $team_id - win $win, loss $loss, tie $tiebr; Why would my results in the database be double what they should be. I even changed the first set from: w = w+$win to w = w+1 and sure enough, instead of the expected result of 7, I got 14. Thank You in Advance Steve - 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: how to check if table exists?
What is the fastest way to check if a table exists? Do a select and catch the error? Try to create the table, and catch the error? Other options? Thanks, Ken sql,query - 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: how to check if table exists?
You can do a couple of things.. Are you using any other language besides SQL? ( perl, PHP? ) If you're just looking for a way to do it with sql.. you can try - show tables like tablename; It'll either give an empty set, or return the tablename. -- sh On Wed, 2002-03-27 at 14:29, Ken Anderson wrote: What is the fastest way to check if a table exists? Do a select and catch the error? Try to create the table, and catch the error? Other options? Thanks, Ken sql,query - 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: how to check if table exists?
java. 'show tables like' is what I needed. Thanks, Ken Steven Hajducko wrote: You can do a couple of things.. Are you using any other language besides SQL? ( perl, PHP? ) If you're just looking for a way to do it with sql.. you can try - show tables like tablename; It'll either give an empty set, or return the tablename. -- sh On Wed, 2002-03-27 at 14:29, Ken Anderson wrote: What is the fastest way to check if a table exists? Do a select and catch the error? Try to create the table, and catch the error? Other options? Thanks, Ken sql,query - 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 - 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: ASP and MySQL
Loretta, Your syntax appears to be correct. Below is an example of what we do (with some bits cut out) and it works. strSQL = INSERT INTO tblTempConsolidation SET _ customerId = intCustomerId , ... strSQL = strSQL orderPrice = 0, _ orderQty = intQty , _ orderSource = 3, _ 245A = ' Replace(strTitle,','') ', _ 100A = ' Replace(strAuthor,','') ', ... objConn.Execute strSQL If you want to forward a little more code directly to me, I am more than happy to have a look. Regards, Greg -Original Message- From: Loretta [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 27 March 2002 16:24 To: [EMAIL PROTECTED] Subject: ASP and MySQL I am having a problem inserting names with apostrophes into the MySQL database. I am using ASP as my front end with standard SQL statements to add, edit and delete records. I read the section in the manual on escape characters and have played around with many different variations trying to get it to work with absolutely no luck. The statement I am currently using looks like this: lname = Replace(Request.Form(lname),','') I have tried using the backslash character and several variations of different numbers of apostrophes. I would appreciate any help as this is the last problem to be solved before the database is functional. The rest of the debugging has been completed. Thank-you in advance, Loretta - 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: addition problem
Just to let everybody know. I found my stupid problem. I was executing the statement twice. Thanks Steve At 03:58 PM 3/27/2002, you wrote: I hope that someone can help me with this. I understood that if I do an update on a row in a table, I could use the SET row=row+1 and that would take what was in that row/column and add a 1 to it. For some reason, it is doubling it. My end result is always twice what it should be. Can anybody explain what I am doing wrong? I have a MySQL Update statement like the following. The variables will either be a 1 (one) or a 0 (zero). -- UPDATE $d SET w = w+$win, l = l+$loss, t = t+$tie, pts = pts+$pts, max_pt = max_pt+$max_pt where team_id = '$team_id' and sea_id = '$sea_id'; -- I even put the following line in right before the UPDATE to make sure that it was putting it in only once so that I could get a printout (I am using PHP): echo team $team_id - win $win, loss $loss, tie $tiebr; Why would my results in the database be double what they should be. I even changed the first set from: w = w+$win to w = w+1 and sure enough, instead of the expected result of 7, I got 14. Thank You in Advance Steve - 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
SELECT frmo two tables
Hey All, I am having problems working on a script and need some advise. Here's my problem. I have two tables with teh following variables: rahs table: name, number, team, position stats table: name, team, penalty, groundballs, shots, faceoffs_won, faceoffs_lost, date and I need to make it so using a pulldown menu I can select player stats by their position but since the position variable isnt in both tables is it possbile to do a select command using a variable from one table for another table? Here's my syntax, but i dont know if it works: $groundballsquery = mysql_query(SELECT SUM(groundballs) AS grouders FROM stats WHERE (position = '$position') FROM rahs); is it possible to do a WHERE command with a FROM command? Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - 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: SELECT frmo two tables
If you need to do a join: http://www.mysql.com/doc/J/O/JOIN.html However I don't see much logic in what you're doing. Stats should not include information that exists in another table, such as name and team. You need to decide what information will be unique (such as player number) or come up with a new field such as player ID to be used in associating tables with one another. E.g., associating by player number: Database.players: player_name, player_number, team, position Database.stats: player_number, penalty, groundballs, shots, faceoffs_won, faceoffs_lost, date SQL:SELECT SUM(stats.groundballs) AS grounders FROM players LEFT JOIN stats ON stats.player_number=players.player_number WHERE players.player_name='$name' -Original Message- From: Alex Behrens [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 27, 2002 4:00 PM To: [EMAIL PROTECTED] Subject: SELECT frmo two tables Hey All, I am having problems working on a script and need some advise. Here's my problem. I have two tables with teh following variables: rahs table: name, number, team, position stats table: name, team, penalty, groundballs, shots, faceoffs_won, faceoffs_lost, date and I need to make it so using a pulldown menu I can select player stats by their position but since the position variable isnt in both tables is it possbile to do a select command using a variable from one table for another table? Here's my syntax, but i dont know if it works: $groundballsquery = mysql_query(SELECT SUM(groundballs) AS grouders FROM stats WHERE (position = '$position') FROM rahs); is it possible to do a WHERE command with a FROM command? Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - 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: SELECT frmo two tables
Look in the mysql manual on joins. http://www.mysql.com/doc/J/O/JOIN.html There is also some articles on this subject at http://www.onlamp.com/onlamp/general/mysql.csp Mike - Original Message - From: Alex Behrens [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 7:00 PM Subject: SELECT frmo two tables Hey All, I am having problems working on a script and need some advise. Here's my problem. I have two tables with teh following variables: rahs table: name, number, team, position stats table: name, team, penalty, groundballs, shots, faceoffs_won, faceoffs_lost, date and I need to make it so using a pulldown menu I can select player stats by their position but since the position variable isnt in both tables is it possbile to do a select command using a variable from one table for another table? Here's my syntax, but i dont know if it works: $groundballsquery = mysql_query(SELECT SUM(groundballs) AS grouders FROM stats WHERE (position = '$position') FROM rahs); is it possible to do a WHERE command with a FROM command? Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - 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 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.330 / Virus Database: 184 - Release Date: 2/28/02 - 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: Coldfusion,Mysql,Myodbc
At 13:29 26/3/2002 +0100, =?us-ascii?Q?Xavier_Prelat?= wrote: Hi, Even if you are using the CFServer 5.0 you will not be able to edit any MySQL DSN with the ColdFusion DSN web admin tool. A clarification here. Is possible ColdFusion to create DSN on the fly using a custom DLL. I did a DLL sometime ago, which you can find it on the contribution page as mydsn with the source for to build on VC++. Regards, Miguel First install the MySQL ODBC on your server, then create any DSN you need using the ODBC Sources tool (administrator tool on Win 2000). Once you created the DSN you want, the CF let you manage the DSN through the web admin interface! hopt it helps. Xavier Xavier Prelat Chief Technical Officer WEBCENTRIC 25 rue de Ponthieu 75008 PARIS - FRANCE http://www.wcentric.com -Message d'origine- De : andy thomas [mailto:[EMAIL PROTECTED]] Envoye : mardi 26 mars 2002 13:14 A : [EMAIL PROTECTED] Cc : [EMAIL PROTECTED]; [EMAIL PROTECTED] Objet : Re: Coldfusion,Mysql,Myodbc On Tue, 26 Mar 2002, [EMAIL PROTECTED] wrote: Hi there . I am new to Mysql.I have to access mysql from coldfusion..and we dont get myODBC as binary for solaris 6 ot 8. so we have to compile them...and i am not able to compile the myODBC bit...its giving compilation problem..Any suggetions from you guys. ColdFusion 4.5.1 and later ship with the Merant ODBC drivers for MySQL and you should be using these. Note that the cfodbc45.so driver shipped with ColdFusion Enterprise Server 5.0 (which lives in ../coldfusion/lib) is broken and you can download a fixed version from Macromedia's web site. Andy - 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 - Please check http://www.mysql.com/Manual_chapter/manual_toc.html; before posting. To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail [EMAIL PROTECTED] instead. -- For technical support contracts, goto https://order.mysql.com/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Miguel A. Solórzano [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, FullTime Developer /_/ /_/\_, /___/\___\_\___/ Mogi das Cruzes - São Paulo, Brazil ___/ www.mysql.com - 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
unix_timesamp function out by a day when using a different timezone
Description: After setting the TZ environment variable to a different timezone, then using the UNIX_TIMESTAMP(...) function on a mysql timestamp string brings back the correct time, but a date that is a day out, but only for certain dates. It seems that the date becomes the original date plus the difference in the timezones. Only the date is affected - not the time. Ie if the new timezone is +5 hours difference, then it will add 5 hours to the timestamp, use that date, then use the original time of the timestamp. Since a timestamp is a timestamp, it should not be affected by the timezone when displaying it. How-To-Repeat: 1. create a timestamp in the database 2. using a select statement, apply the UNIX_TIMESTAMP function to the timestamp 3. change the TZ environment var to another timezone 4. using a select statement, apply the UNIX_TIMESTAMP function to the timestamp repeat these steps for each of the 24 hours in the day for the original timestamp, and you will see that some of them will have different dates. Fix: ??? Submitter-Id: submitter ID Originator:Dominic Gamble Organization: MySQL support: [none | licence | email support | extended email support ] Synopsis: unix_timestamp function out by a day when using a different timezone Severity: Priority: Category: mysql Class: Release: mysql-3.23.47 (Source distribution) Server: /usr/bin/mysqladmin Ver 8.23 Distrib 3.23.47, for pc-linux-gnu on i686 Copyright (C) 2000 MySQL AB MySQL Finland AB TCX DataKonsult AB This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL license Server version 3.23.47-log Protocol version10 Connection Localhost via UNIX socket UNIX socket /var/run/mysqld/mysqld.sock Uptime: 2 hours 27 min 11 sec Threads: 7 Questions: 1291 Slow queries: 0 Opens: 61 Flush tables: 1 Open tables: 14 Queries per second avg: 0.146 Environment: System: Linux kepler 2.4.14 #5 Thu Nov 22 11:29:10 EST 2001 i686 unknown Architecture: i686 Some paths: /usr/bin/perl /usr/bin/make /usr/bin/gcc /usr/bin/cc GCC: Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs gcc version 2.95.4 20011006 (Debian prerelease) Compilation info: CC='gcc' CFLAGS='' CXX='c++' CXXFLAGS='' LDFLAGS='' LIBC: lrwxrwxrwx1 root root 13 Mar 20 18:08 /lib/libc.so.6 - libc-2.2.5.so -rwxr-xr-x1 root root 1170812 Feb 4 18:03 /lib/libc-2.2.5.so -rw-r--r--1 root root 2667532 Feb 4 18:03 /usr/lib/libc.a -rw-r--r--1 root root 178 Feb 4 18:03 /usr/lib/libc.so Configure command: ./configure --prefix=/usr --exec-prefix=/usr --libexecdir=/usr/sbin --datadir=/usr/share --sysconfdir=/etc/mysql --localstatedir=/var/lib/mysql --includedir=/usr/include --infodir=/usr/share/info --mandir=/usr/share/man --enable-shared --with-libwrap --enable-assembler --with-berkeley-db --with-innodb --enable-static --enable-shared --with-raid --enable-thread-safe-client --without-readline --with-unix-socket-path=/var/run/mysqld/mysqld.sock --with-mysqld-user=mysql --without-bench --with-client-ldflags=-lstdc++ --with-extra-charsets=all - 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: unix_timesamp function out by a day when using a differenttimezone
Description: After setting the TZ environment variable to a different timezone, then using the UNIX_TIMESTAMP(...) function on a mysql timestamp string brings back the correct time, but a date that is a day out, but only for certain dates. It seems that the date becomes the original date plus the difference in the timezones. Only the date is affected - not the time. Ie if the new timezone is +5 hours difference, then it will add 5 hours to the timestamp, use that date, then use the original time of the timestamp. Since a timestamp is a timestamp, it should not be affected by the timezone when displaying it. They're stored in GMT but converted to the server's timezone for display. How-To-Repeat: 1. create a timestamp in the database 2. using a select statement, apply the UNIX_TIMESTAMP function to the timestamp 3. change the TZ environment var to another timezone 4. using a select statement, apply the UNIX_TIMESTAMP function to the timestamp repeat these steps for each of the 24 hours in the day for the original timestamp, and you will see that some of them will have different dates. - 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: Replication Failure (or Bug?): Cannot Connect, but Should?
Thanks Steven, I can telnet to port 3306 of the master system just fine. A (likely unimportant and useless) test I did was to telnet to 3306 on the master and then run netstat -an on the master to see if the connect was made. Yes it was... tcp0 0 10.0.0.10:3306 10.0.0.9:3017 ESTABLISHED What are the chances that MySQL doesn't work so well with 10.0.0.0 network addresses? I did flush privileges after adding the user. It didn't help. I had the same feeling about the configuration file being incorrect because of the IP address and timeout not being set correctly. I have compared yours and mine and don't see any significant differences except that I am using a numerical IP address for my master-host. Here is my slave my.cnf: [mysqld] datadir=/home/mysql socket=/var/lib/mysql/mysql.sock server-id=2 master-host=10.0.0.10 master-user=repl master-password=password master-connect-retry=10 master-port=3306 [mysql.server] user=mysql basedir=/home/mysql [safe_mysqld] err-log=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid Thanks for any more help you can give, Leonard At 09:39 AM 3/27/2002 -0800, Steven Hajducko wrote: Hrm, I'll take a stab at it, since I've got replication working atm... Have you tried basic connectivity tests between the slave and master? ( Just making sure.. ie - can you telnet to port 3306 on the master, from the slave? ) Did you flush the privileges after adding the repl user? Here's my master my.cnf - [mysqld] port= 3306 socket = /tmp/mysql.sock skip-locking skip-innodb set-variable= key_buffer=16M set-variable= max_allowed_packet=1M set-variable= table_cache=64 set-variable= sort_buffer=512K set-variable= net_buffer_length=8K set-variable= myisam_sort_buffer_size=8M log-bin server-id = 1 And slave my.cnf - [mysqld] port= 3306 socket = /tmp/mysql.sock skip-locking skip-innodb set-variable= key_buffer=16M set-variable= max_allowed_packet=1M set-variable= table_cache=64 set-variable= sort_buffer=512K set-variable= net_buffer_length=8K set-variable= myisam_sort_buffer_size=8M log-bin server-id = 2 master-host=db.mine.com master-user=bkup master-password=password master-port=3306 Can you copy and paste your whole my.cnf from the slave? It doesn't sound like it's reading it correctly ( maybe why it's keeping the timeout at 0 and trying to connect to the wrong ip? ) -- sh On Wed, 2002-03-27 at 09:16, Leonard Megliola wrote: Sorry to bring this up again, but I haven't received any helpful responses. Does anyone have any clues about this or is this something I should report as a bug? I can't imagine it is. Thank you, Leonard At 12:43 AM 3/26/2002 -0800, you wrote: Hello, I have been attempting to get replication working for a week now and am having little luck. I have followed the instructions in the documentation but get the following errors in the error log on the slave server: 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec Here are the relevant lines from my configuration files Master my.cnf: [mysqld] socket=/var/lib/mysql/mysql.sock log-bin server-id=1 Slave my.cnf: [mysqld] socket=/var/lib/mysql/mysql.sock master-host=10.0.0.10 master-user=repl master-password=password master-connect-retry=10 master-port=3306 server-id=2 I created the repl account on the master and have tried giving it FILE privileges and ALL PRIVILEGES on '%', '10.0.0.10' and the hostname of the slave server. The thing that stands out most for me about the error messages is that it says Can't connect to MySQL server on '0' when I have clearly entered the IP address, and that it says retrying in 0 seconds when I made the timeout 10 seconds. The MySQL version on the master server is 3.23.35 and the slave version is at 3.23.32. Any help would be greatly appreciated. Thanks, Leonard P.S. sql query - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list
Re: Replication Failure (or Bug?): Cannot Connect, but Should?
Thanks Scott. It looks like permissions could be the issue, but checking out the table shows that I have all of the correct permissions setup exactly as you have listed them below. If you have any other ideas, I'd appreciate them. Thanks, Leonard At 12:49 PM 3/27/2002 -0500, you wrote: Leonard, This is pretty clearly (IMHO) a permissions issue. Make sure the username you use to replicate with, has a '%' in the Host field of the user table. mysql use mysql mysql select * from user where user = 'your_replication_user' \G *** 1. row *** Host: % User: your_replication_user Password: encrypted_password Select_priv: N Insert_priv: N Update_priv: N Delete_priv: N Create_priv: N Drop_priv: N Reload_priv: N Shutdown_priv: N Process_priv: N File_priv: Y Grant_priv: N References_priv: N Index_priv: N Alter_priv: N 1 row in set (0.01 sec) Scott Helms Director of Technology, ZCorum - Original Message - From: Leonard Megliola [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 12:16 PM Subject: Re: Replication Failure (or Bug?): Cannot Connect, but Should? Sorry to bring this up again, but I haven't received any helpful responses. Does anyone have any clues about this or is this something I should report as a bug? I can't imagine it is. Thank you, Leonard At 12:43 AM 3/26/2002 -0800, you wrote: Hello, I have been attempting to get replication working for a week now and am having little luck. I have followed the instructions in the documentation but get the following errors in the error log on the slave server: 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec Here are the relevant lines from my configuration files Master my.cnf: [mysqld] socket=/var/lib/mysql/mysql.sock log-bin server-id=1 Slave my.cnf: [mysqld] socket=/var/lib/mysql/mysql.sock master-host=10.0.0.10 master-user=repl master-password=password master-connect-retry=10 master-port=3306 server-id=2 I created the repl account on the master and have tried giving it FILE privileges and ALL PRIVILEGES on '%', '10.0.0.10' and the hostname of the slave server. The thing that stands out most for me about the error messages is that it says Can't connect to MySQL server on '0' when I have clearly entered the IP address, and that it says retrying in 0 seconds when I made the timeout 10 seconds. The MySQL version on the master server is 3.23.35 and the slave version is at 3.23.32. Any help would be greatly appreciated. Thanks, Leonard P.S. sql query - 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 - 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:
Re: Replication Failure (or Bug?): Cannot Connect, but Should?
Leonard, What command are you using to start the slave server? I was thinking maybe it wasn't reading the correct configuration file? This one is pretty strange. Have you thought about upgrading the slave mysql version, just to disregard that it might be a problem between the two versions? One thing, in your user table, are you using the hostname of the slave server to specify where it's coming from? ( I know you said you did % already, so this shouldn't matter.. but.. who knows? ). Here's what my replication user looks like - | %| bkup | password | N | N | N | N | N | N | N | N | N| Y | N | N | N | N | What do you currently have in the mysql 'user' table for the repl user? -- sh On Wed, 2002-03-27 at 17:18, Leonard Megliola wrote: Thanks Scott. It looks like permissions could be the issue, but checking out the table shows that I have all of the correct permissions setup exactly as you have listed them below. If you have any other ideas, I'd appreciate them. Thanks, Leonard At 12:49 PM 3/27/2002 -0500, you wrote: Leonard, This is pretty clearly (IMHO) a permissions issue. Make sure the username you use to replicate with, has a '%' in the Host field of the user table. mysql use mysql mysql select * from user where user = 'your_replication_user' \G *** 1. row *** Host: % User: your_replication_user Password: encrypted_password Select_priv: N Insert_priv: N Update_priv: N Delete_priv: N Create_priv: N Drop_priv: N Reload_priv: N Shutdown_priv: N Process_priv: N File_priv: Y Grant_priv: N References_priv: N Index_priv: N Alter_priv: N 1 row in set (0.01 sec) Scott Helms Director of Technology, ZCorum - Original Message - From: Leonard Megliola [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 12:16 PM Subject: Re: Replication Failure (or Bug?): Cannot Connect, but Should? Sorry to bring this up again, but I haven't received any helpful responses. Does anyone have any clues about this or is this something I should report as a bug? I can't imagine it is. Thank you, Leonard At 12:43 AM 3/26/2002 -0800, you wrote: Hello, I have been attempting to get replication working for a week now and am having little luck. I have followed the instructions in the documentation but get the following errors in the error log on the slave server: 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec Here are the relevant lines from my configuration files Master my.cnf: [mysqld] socket=/var/lib/mysql/mysql.sock log-bin server-id=1 Slave my.cnf: [mysqld] socket=/var/lib/mysql/mysql.sock master-host=10.0.0.10 master-user=repl master-password=password master-connect-retry=10 master-port=3306 server-id=2 I created the repl account on the master and have tried giving it FILE privileges and ALL PRIVILEGES on '%', '10.0.0.10' and the hostname of the slave server. The thing that stands out most for me about the error messages is that it says Can't connect to MySQL server on '0' when I have clearly entered the IP address, and that it says retrying in 0 seconds when I made the timeout 10 seconds. The MySQL version on the master server is 3.23.35 and the slave version is at 3.23.32. Any help would be greatly appreciated. Thanks, Leonard P.S. sql query - 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: unix_timesamp function out by a day when using a differenttimezone
On Thu, 2002-03-28 at 12:15, Paul DuBois wrote: Description: After setting the TZ environment variable to a different timezone, then using the UNIX_TIMESTAMP(...) function on a mysql timestamp string brings back the correct time, but a date that is a day out, but only for certain dates. It seems that the date becomes the original date plus the difference in the timezones. Only the date is affected - not the time. Ie if the new timezone is +5 hours difference, then it will add 5 hours to the timestamp, use that date, then use the original time of the timestamp. Since a timestamp is a timestamp, it should not be affected by the timezone when displaying it. They're stored in GMT but converted to the server's timezone for display. Sure, but why does the date change, and not the time? The conversion is muddling itself. How-To-Repeat: 1. create a timestamp in the database 2. using a select statement, apply the UNIX_TIMESTAMP function to the timestamp 3. change the TZ environment var to another timezone 4. using a select statement, apply the UNIX_TIMESTAMP function to the timestamp repeat these steps for each of the 24 hours in the day for the original timestamp, and you will see that some of them will have different dates. - 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: SELECT frmo two tables
hey guys, this mysql line doesn't seem to work: SELECT SUM(s.groundballs) AS grounders FROM stats s LEFT JOIN rahs r ON s.name = r.name WHERE (s.position = '$position') why not? is there somethign wrong with my syntax? it says this error: Supplied argument is not a valid MySQL result resource Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - Original Message - From: Ron Jamison [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 6:21 PM Subject: RE: SELECT frmo two tables If you need to do a join: http://www.mysql.com/doc/J/O/JOIN.html However I don't see much logic in what you're doing. Stats should not include information that exists in another table, such as name and team. You need to decide what information will be unique (such as player number) or come up with a new field such as player ID to be used in associating tables with one another. E.g., associating by player number: Database.players: player_name, player_number, team, position Database.stats: player_number, penalty, groundballs, shots, faceoffs_won, faceoffs_lost, date SQL: SELECT SUM(stats.groundballs) AS grounders FROM players LEFT JOIN stats ON stats.player_number=players.player_number WHERE players.player_name='$name' -Original Message- From: Alex Behrens [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 27, 2002 4:00 PM To: [EMAIL PROTECTED] Subject: SELECT frmo two tables Hey All, I am having problems working on a script and need some advise. Here's my problem. I have two tables with teh following variables: rahs table: name, number, team, position stats table: name, team, penalty, groundballs, shots, faceoffs_won, faceoffs_lost, date and I need to make it so using a pulldown menu I can select player stats by their position but since the position variable isnt in both tables is it possbile to do a select command using a variable from one table for another table? Here's my syntax, but i dont know if it works: $groundballsquery = mysql_query(SELECT SUM(groundballs) AS grouders FROM stats WHERE (position = '$position') FROM rahs); is it possible to do a WHERE command with a FROM command? Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - 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 - 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: SELECT frmo two tables
I would check the value of $position to make sure it's what you want. Mike - Original Message - From: Alex Behrens [EMAIL PROTECTED] To: Ron Jamison [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 9:14 PM Subject: Re: SELECT frmo two tables hey guys, this mysql line doesn't seem to work: SELECT SUM(s.groundballs) AS grounders FROM stats s LEFT JOIN rahs r ON s.name = r.name WHERE (s.position = '$position') why not? is there somethign wrong with my syntax? it says this error: Supplied argument is not a valid MySQL result resource Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - Original Message - From: Ron Jamison [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 6:21 PM Subject: RE: SELECT frmo two tables If you need to do a join: http://www.mysql.com/doc/J/O/JOIN.html However I don't see much logic in what you're doing. Stats should not include information that exists in another table, such as name and team. You need to decide what information will be unique (such as player number) or come up with a new field such as player ID to be used in associating tables with one another. E.g., associating by player number: Database.players: player_name, player_number, team, position Database.stats: player_number, penalty, groundballs, shots, faceoffs_won, faceoffs_lost, date SQL: SELECT SUM(stats.groundballs) AS grounders FROM players LEFT JOIN stats ON stats.player_number=players.player_number WHERE players.player_name='$name' -Original Message- From: Alex Behrens [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 27, 2002 4:00 PM To: [EMAIL PROTECTED] Subject: SELECT frmo two tables Hey All, I am having problems working on a script and need some advise. Here's my problem. I have two tables with teh following variables: rahs table: name, number, team, position stats table: name, team, penalty, groundballs, shots, faceoffs_won, faceoffs_lost, date and I need to make it so using a pulldown menu I can select player stats by their position but since the position variable isnt in both tables is it possbile to do a select command using a variable from one table for another table? Here's my syntax, but i dont know if it works: $groundballsquery = mysql_query(SELECT SUM(groundballs) AS grouders FROM stats WHERE (position = '$position') FROM rahs); is it possible to do a WHERE command with a FROM command? Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - 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 - 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 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.330 / Virus Database: 184 - Release Date: 2/28/02 - 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: SELECT frmo two tables
At 20:14 -0600 3/27/02, Alex Behrens wrote: hey guys, this mysql line doesn't seem to work: SELECT SUM(s.groundballs) AS grounders FROM stats s LEFT JOIN rahs r ON s.name = r.name WHERE (s.position = '$position') why not? is there somethign wrong with my syntax? it says this error: Supplied argument is not a valid MySQL result resource You're leaving out details, namely the surrounding PHP code from within which you're executing this statement. My guess is that you didn't check the result from mysql_query() to see whether or not it succeeeded. Do so, and if it fails, print the value of mysql_error() to see what it says. Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - 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: SELECT frmo two tables
This is the code I'm using and I'm a newbie so this is still a lil challenging for me: $numberquery = mysql_query(SELECT SUM(s.groundballs) AS grounders FROM stats s LEFT JOIN rahs r ON s.name = r.name WHERE (s.position = '$position')); while($number=mysql_fetch_array($numberquery)){ printf (Total groundballs for $position: %s/font/td,$number[grounders]); } Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - Original Message - From: Paul DuBois [EMAIL PROTECTED] To: Alex Behrens [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 9:45 PM Subject: Re: SELECT frmo two tables At 20:14 -0600 3/27/02, Alex Behrens wrote: hey guys, this mysql line doesn't seem to work: SELECT SUM(s.groundballs) AS grounders FROM stats s LEFT JOIN rahs r ON s.name = r.name WHERE (s.position = '$position') why not? is there somethign wrong with my syntax? it says this error: Supplied argument is not a valid MySQL result resource You're leaving out details, namely the surrounding PHP code from within which you're executing this statement. My guess is that you didn't check the result from mysql_query() to see whether or not it succeeeded. Do so, and if it fails, print the value of mysql_error() to see what it says. Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - 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: SELECT frmo two tables
In addition to Paul's suggestion of using mysql_error to check to see if it was successful, when I'm having trouble I like to print the query in the output for testing and then try to run the query from the MySQL CLI. print SELECT SUM(s.groundballs) AS grounders FROM stats s LEFT JOIN rahs r ON s.name = r.name WHERE (s.position ='$position');; I've found that this helps to see what I'm trying to have MySQL do. Steve On Wed, Mar 27, 2002 at 09:53:33PM -0600, Alex Behrens wrote: This is the code I'm using and I'm a newbie so this is still a lil challenging for me: $numberquery = mysql_query(SELECT SUM(s.groundballs) AS grounders FROM stats s LEFT JOIN rahs r ON s.name = r.name WHERE (s.position = '$position')); while($number=mysql_fetch_array($numberquery)){ printf (Total groundballs for $position: %s/font/td,$number[grounders]); } Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - Original Message - From: Paul DuBois [EMAIL PROTECTED] To: Alex Behrens [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 9:45 PM Subject: Re: SELECT frmo two tables At 20:14 -0600 3/27/02, Alex Behrens wrote: hey guys, this mysql line doesn't seem to work: SELECT SUM(s.groundballs) AS grounders FROM stats s LEFT JOIN rahs r ON s.name = r.name WHERE (s.position = '$position') why not? is there somethign wrong with my syntax? it says this error: Supplied argument is not a valid MySQL result resource You're leaving out details, namely the surrounding PHP code from within which you're executing this statement. My guess is that you didn't check the result from mysql_query() to see whether or not it succeeeded. Do so, and if it fails, print the value of mysql_error() to see what it says. Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - 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: SELECT frmo two tables
In my experience, this is frequently the result of a failed connect. Did you verify that the connect statement succeeded? If not, and it didn't, the select will fail, of course, and this is the error you'll get. Mike's advice, checking the value of $position, is also good. By the way, you ask what's wrong with the SQL, but the error message you give is from Perl, yes? It's usually a good idea to mention that and post the real code. Makes it easier to help, not to mention that sometimes while editing the command, you inadvertently remove the real error. Michael On Wed, 27 Mar 2002, Mike wrote: I would check the value of $position to make sure it's what you want. Mike - Original Message - From: Alex Behrens [EMAIL PROTECTED] To: Ron Jamison [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 9:14 PM Subject: Re: SELECT frmo two tables hey guys, this mysql line doesn't seem to work: SELECT SUM(s.groundballs) AS grounders FROM stats s LEFT JOIN rahs r ON s.name = r.name WHERE (s.position = '$position') why not? is there somethign wrong with my syntax? it says this error: Supplied argument is not a valid MySQL result resource Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - Original Message - From: Ron Jamison [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 6:21 PM Subject: RE: SELECT frmo two tables If you need to do a join: http://www.mysql.com/doc/J/O/JOIN.html However I don't see much logic in what you're doing. Stats should not include information that exists in another table, such as name and team. You need to decide what information will be unique (such as player number) or come up with a new field such as player ID to be used in associating tables with one another. E.g., associating by player number: Database.players: player_name, player_number, team, position Database.stats: player_number, penalty, groundballs, shots, faceoffs_won, faceoffs_lost, date SQL: SELECT SUM(stats.groundballs) AS grounders FROM players LEFT JOIN stats ON stats.player_number=players.player_number WHERE players.player_name='$name' -Original Message- From: Alex Behrens [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 27, 2002 4:00 PM To: [EMAIL PROTECTED] Subject: SELECT frmo two tables Hey All, I am having problems working on a script and need some advise. Here's my problem. I have two tables with teh following variables: rahs table: name, number, team, position stats table: name, team, penalty, groundballs, shots, faceoffs_won, faceoffs_lost, date and I need to make it so using a pulldown menu I can select player stats by their position but since the position variable isnt in both tables is it possbile to do a select command using a variable from one table for another table? Here's my syntax, but i dont know if it works: $groundballsquery = mysql_query(SELECT SUM(groundballs) AS grouders FROM stats WHERE (position = '$position') FROM rahs); is it possible to do a WHERE command with a FROM command? Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - 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 - 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
Re: SELECT frmo two tables
At 21:53 -0600 3/27/02, Alex Behrens wrote: This is the code I'm using and I'm a newbie so this is still a lil challenging for me: $numberquery = mysql_query(SELECT SUM(s.groundballs) AS grounders FROM stats s LEFT JOIN rahs r ON s.name = r.name WHERE (s.position = '$position')); As I suspected, you're not checking the result from mysql_query() to see whether or not it succeeded. Do so: if (!$numberquery) die (Query failed, error is: . mysql_error ()); You're just shooting yourself in the foot and wasting your time if you don't check for errors. while($number=mysql_fetch_array($numberquery)){ printf (Total groundballs for $position: %s/font/td,$number[grounders]); } Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - Original Message - From: Paul DuBois [EMAIL PROTECTED] To: Alex Behrens [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 9:45 PM Subject: Re: SELECT frmo two tables At 20:14 -0600 3/27/02, Alex Behrens wrote: hey guys, this mysql line doesn't seem to work: SELECT SUM(s.groundballs) AS grounders FROM stats s LEFT JOIN rahs r ON s.name = r.name WHERE (s.position = '$position') why not? is there somethign wrong with my syntax? it says this error: Supplied argument is not a valid MySQL result resource You're leaving out details, namely the surrounding PHP code from within which you're executing this statement. My guess is that you didn't check the result from mysql_query() to see whether or not it succeeeded. Do so, and if it fails, print the value of mysql_error() to see what it says. Thanks! -Alex Big Al Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] - 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
Why doesn't % work?
Hi, I have set up a user call FooBar and I have set up the host that FooBar can access from %, but everytime I go to a different machine I get an error that FooBar can't access mysql from that machine IP address. Why isn't the wildcard (%) working? I am using 3.23.44 with mysql-max. Any clues would be great. Thanks. | Chuck Payne | | Magi Design and Support | | www.magidesign.com | | [EMAIL PROTECTED] | BeOS, Macintosh 68K, Classic, and OS X, Linux Support. Web Design you can afford. Never be bullied into silence. Never allow yourself to be made a victim. Accept no one's definition of your life; define yourself.- Harvey Fierstein sql - 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: Why doesn't % work?
At 23:37 -0500 3/27/02, Chuck \PUP\ Payne wrote: Hi, I have set up a user call FooBar and I have set up the host that FooBar can access from %, but everytime I go to a different machine I get an error that FooBar can't access mysql from that machine IP address. Why isn't the wildcard (%) working? Delete the records from the user table that have blank User fields: DELETE FROM mysql.user WHERE User = ''; FLUSH PRIVILEGES; Then try again. I am using 3.23.44 with mysql-max. Any clues would be great. Thanks. | Chuck Payne | | Magi Design and Support | | www.magidesign.com | | [EMAIL PROTECTED] | BeOS, Macintosh 68K, Classic, and OS X, Linux Support. Web Design you can afford. Never be bullied into silence. Never allow yourself to be made a victim. Accept no one's definition of your life; define yourself.- Harvey Fierstein sql - 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
Host permissions
I have read the mail archives and am still confuessed. mysql version 3.23.49-5 running under debian kernel 2.4.12 I cannot connect to the mysql server from the outside world. I have added a host permission to allow anyone to any database. Can someone assist ? Regards Paul - 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
C API question
In a table, I declared a column which is an integer unsigned. After calling mysql_fetch_row, I need to convert the value of the column (i.e. row[0]) to a string. I tried to solve it doing this: char var[11]; sprintf (var, %u, row[0]); , but it doesn't work. Is *row[0] an unsigned int? Can anybody help me??? _ Con MSN Hotmail súmese al servicio de correo electrónico más grande del mundo. http://www.hotmail.com/ES - 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: Host permissions
Do what Paul DuBois just suggested a few minutes ago on this very list: Delete the records from the user table that have blank User fields: DELETE FROM mysql.user WHERE User = ''; FLUSH PRIVILEGES; Then try again. That might help. Is your mysql server box behind a firewall? If it is, you might want to open port 3306 on the firewall. Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com - Original Message - From: Paul Rose [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 11:07 PM Subject: Host permissions I have read the mail archives and am still confuessed. mysql version 3.23.49-5 running under debian kernel 2.4.12 I cannot connect to the mysql server from the outside world. I have added a host permission to allow anyone to any database. Can someone assist ? Regards Paul - 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: C API question
At 5:09 + 3/28/02, Federico Halperin wrote: In a table, I declared a column which is an integer unsigned. After calling mysql_fetch_row, I need to convert the value of the column (i.e. row[0]) to a string. According to the manual, *all* column values are returned as strings. I'd say you don't need to convert it. I tried to solve it doing this: char var[11]; sprintf (var, %u, row[0]); , but it doesn't work. Is *row[0] an unsigned int? Can anybody help me??? It's a good idea to take a good look at the descriptions of these functions (and the data types they use) in the manual to see how they work. No point in guessing. - 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
Some permissions help
Hey all, we have a new subscriber here :) I'm working on a MySQL permissions problem, and would welcome some suggestions and/or comments, or to be pointed in the right direction. The goals I have are: a) Limit users to specific db's (no access to mysql.*/etc.) b) Eliminate anony browsing of db's.. and ideally eliminate ability to view a complete list of all db's. First, I want to cut down anony privs.. (I honestly don't know what they are set to be default, so this might not be neccesary.) GRANT usage ON * TO ''@'localhost'; Next, we want to assign privileges to individual users on the database, but make sure they can only access their OWN db's. For this: GRANT create,delete,drop,index,insert,select,update ON users_db.* to 'user_name'@'localhost' identified by 'password'; Would anyone be able to let me know if this could/should work? (Don't have a mysql server here to test this w/ at the moment, so your input would be appreciated.) If I'm way off on this, I'd really appreciate any pointers in the right direction.. Thanks! Ryan - 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
newbie installing MySQL/InnoDB on RH 7.1
I need some newbie help... I've installed RedHat7.1 off RH7.1 CDs, also, installed MySQL that came with it, the installed MySQL did NOT have InnoDB support; I then d/l off mysql.com MySQL-Max-3.23.49a-1.i386.rpm I installed it using: rpm --install MySQL-Max-3.23.49a-1.i386.rpm (I think that's how it's meant to be installed, I'm a newbie) howver, on restart. the 'original CD revison' started, NOT, MAX then, i tried starting MySQL-Max by explicitly calling it, it said: 'you have wrong error files' SO: using webmin, I removed all mysql packages; then, using webmin, installed MySQL-Max-3.23.49a-1.i386.rpm now it tell me, the MySQL-Max-3.23.49a is only an extension: Optional MySQL server binary that supports features like transactional tables. To active this binary, just install this package after the MySQL package. - but, reading on mysql download page, implies, MySQL-Max-3.23.49a-1.i386.rpm is all I need... help so, at this time: accoriding to webmin I have: Packages matching mysql Package Class Description MySQL-Max 3.23.49a-1 Applications/Databases MySQL - server with Berkeley DB and Innodb support perl-DBD-MySQL 1.2215-1 Applications/CPAN A MySQL interface for perl php-mysql 4.0.4pl1-9 Development/Languages A module for PHP applications that use MySQL databases. -- webmin says: MySQL Database Server The MySQL admin program /usr/bin/mysqladmin was not found on your system. Maybe MySQL is not installed, or your module configuration is incorrect. can this MySQL run as a server ? where is a client [root@charly /]# /etc/rc.d/init.d/mysqld start bash: /etc/rc.d/init.d/mysqld: No such file or directory [root@charly /]# clueless, Voytek Eymont http://www.sbt.net.au/links/ - 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: Replication Failure (or Bug?): Cannot Connect, but Should?
Honestly, I don't know what was wrong, but I have managed to get this problem fixed. It was one of two things... I upgraded the MySQL slave server to 3.23.49a. I also deleted the master.info file based on something I read in the release info for all of the releases in between the release that I was running and the one that I just installed. Deleting the master.info file must have done the trick because I fired up the slave server and everything is now running beautifully. Next question: do you have to manually delete the bin files on the master server and how do you know when you can do that? Thanks, Leonard At 05:30 PM 3/27/2002 -0800, Steven Hajducko wrote: Leonard, What command are you using to start the slave server? I was thinking maybe it wasn't reading the correct configuration file? This one is pretty strange. Have you thought about upgrading the slave mysql version, just to disregard that it might be a problem between the two versions? One thing, in your user table, are you using the hostname of the slave server to specify where it's coming from? ( I know you said you did % already, so this shouldn't matter.. but.. who knows? ). Here's what my replication user looks like - | %| bkup | password | N | N | N | N | N | N | N | N | N| Y | N | N | N | N | What do you currently have in the mysql 'user' table for the repl user? -- sh On Wed, 2002-03-27 at 17:18, Leonard Megliola wrote: Thanks Scott. It looks like permissions could be the issue, but checking out the table shows that I have all of the correct permissions setup exactly as you have listed them below. If you have any other ideas, I'd appreciate them. Thanks, Leonard At 12:49 PM 3/27/2002 -0500, you wrote: Leonard, This is pretty clearly (IMHO) a permissions issue. Make sure the username you use to replicate with, has a '%' in the Host field of the user table. mysql use mysql mysql select * from user where user = 'your_replication_user' \G *** 1. row *** Host: % User: your_replication_user Password: encrypted_password Select_priv: N Insert_priv: N Update_priv: N Delete_priv: N Create_priv: N Drop_priv: N Reload_priv: N Shutdown_priv: N Process_priv: N File_priv: Y Grant_priv: N References_priv: N Index_priv: N Alter_priv: N 1 row in set (0.01 sec) Scott Helms Director of Technology, ZCorum - Original Message - From: Leonard Megliola [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 12:16 PM Subject: Re: Replication Failure (or Bug?): Cannot Connect, but Should? Sorry to bring this up again, but I haven't received any helpful responses. Does anyone have any clues about this or is this something I should report as a bug? I can't imagine it is. Thank you, Leonard At 12:43 AM 3/26/2002 -0800, you wrote: Hello, I have been attempting to get replication working for a week now and am having little luck. I have followed the instructions in the documentation but get the following errors in the error log on the slave server: 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:22 Slave thread: error connecting to master:Host 'www1' is not allowed to connect to this MySQL server(0), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec 020325 0:32:24 Slave thread: error connecting to master:Can't connect to MySQL server on '0' (11)(107), retry in 0 sec Here are the relevant lines from my configuration files Master my.cnf: [mysqld] socket=/var/lib/mysql/mysql.sock log-bin server-id=1 Slave my.cnf: [mysqld] socket=/var/lib/mysql/mysql.sock master-host=10.0.0.10 master-user=repl master-password=password master-connect-retry=10 master-port=3306 server-id=2 I created the repl account on the master and have tried giving it FILE privileges and ALL PRIVILEGES on '%', '10.0.0.10' and the hostname of the slave server. The thing that stands out most for me about the error messages is that it says Can't connect to MySQL server on '0'
RE: To run MySQL Server from the remote machine
hi, Is it possible to run the MySQL Server from the remote machine..?? Mysql provides a Api's for shutting down the server from the remote place i.e. ( mysql_shutdown(mysqlhadler)) but I can't see any api for starting the Mysql server from the remote machine. Does it mean that every time when I have to run the server it will be done manually... Please, if anybody knows about this..?? do help me.. I have to do this as soon as possible...?? Thanks and regards, Chetan Lavti - 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
Unicode problem
All Hi! I am a developer of My SQL, and I am developing an application use unicode so I would like to ask you which version that support Unicode and where can I get it. Now I am using My SQL version 3.23.49 thanks alots - 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: C API question
hi, I think u don't need to convert it in to string... all the column values comes out in string only... or even u need to use atoi() Function for getting the Int ot unsigned int... I have used it... Chetan Lavti -Original Message- From: Federico Halperin [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 28, 2002 10:40 AM Subject: C API question In a table, I declared a column which is an integer unsigned. After calling mysql_fetch_row, I need to convert the value of the column (i.e. row[0]) to a string. I tried to solve it doing this: char var[11]; sprintf (var, %u, row[0]); , but it doesn't work. Is *row[0] an unsigned int? Can anybody help me??? _ Con MSN Hotmail súmese al servicio de correo electrónico más grande del mundo. http://www.hotmail.com/ES - 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
Adding an index to a table
Hi, I have a MySQL database that currently is used by about 8000 users. I need to add an index to one of the fields in one of the tables to help speed up a particular query being made to the MySQL database. I am a bit nervous to do so in case I screw up. Mind you I have backed up the databases all ready. 1 - What command do I issue to add a simple index to one field in a table. 2 - Do I have to do anything special like stop requests to the server while I add the index. 3 - How safe is this to do? Many thanks. James - 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: C API question
hi, I think u don't need to convert it in to string... all the column values comes out in string only... I have used it... Chetan Lavti -Original Message- From: Federico Halperin [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 28, 2002 10:40 AM Subject: C API question In a table, I declared a column which is an integer unsigned. After calling mysql_fetch_row, I need to convert the value of the column (i.e. row[0]) to a string. I tried to solve it doing this: char var[11]; sprintf (var, %u, row[0]); , but it doesn't work. Is *row[0] an unsigned int? Can anybody help me??? _ Con MSN Hotmail súmese al servicio de correo electrónico más grande del mundo. http://www.hotmail.com/ES - 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: DRDB vs. MySQL replication
Hello Jens, Wednesday, March 27, 2002, 2:43:22 PM, you wrote: We have tried to use DRBD with MySQL/EXT3/NFS and some other applications. Generally it works rather good, showing rather nice performance. The only problem we had was problem with EXT3 corruption, which was in earlier (2-3 months) versions. So You should test carefully how it will work with your environment, including the processes of fallback/recover during the notable load. Also the problem with MySQL is you will need to check the tables before using them if you're using MYISAM, therefore using INNODB or BDB will help to recover mysql quite fast. Also you may note with MySQL replication you may execute select queries on Slave, which is really nice solution for statistical scripts which may execute long selects or database backup. In case with DRBD you will miss it. On other side in this case you will not have any need to care about some features which have trouble with replication - like load data infile, variables etc. Also a good thing with DRBD you will not have to store and track replication log files and the setup will not require to take MySQL down to copy the snapshot of database. JV has anyone used DRDB (http://www.linbit.com/) instead of the standard MySQL JV replication? JV DRDB implements a virtual disk mirrored across a local disk and a disk in a JV remote stand-by server. JV On first thought, it adds some complexity to setup, but it can also JV replicate information not written to MySQL but e.g. directly to the JV filesystem. JV Any thoughts on this? -- Best regards, Petermailto:[EMAIL PROTECTED] - 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