Re: MySQL Replication Error
I spoke to soon!!! Here is the error about 1.5 hours after replication has started. 121205 16:39:51 [ERROR] Slave: Error 'Duplicate entry '3468897' for key 1' on query. Default database: 'parallax'. Query: 'INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'page not found', 'images/internet_explorer/borderTopLeft.png', 'N;', 4, '', ' http://www.sdcwa.org/es/images/internet_explorer/borderTopLeft.png', '', '10.20.141.24', 1354754352)', Error_code: 1062 121205 16:39:51 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with SLAVE START. We stopped at log 'mysql-bin.000289' position 86451409 Sorry for the long message, below are the steps use to create my replication. When I created the replication, I followed the steps here : http://crazytoon.com/2008/01/29/mysql-how-do-you-set-up-masterslave-replication-in-mysql-centos-rhel-fedora/ I am on a red hat server. --- I set my firewall to accept info from server1 on server2 SERVER1: tcp0 0 wahoo.sdcwa.org:mysql wahooesc.sdcwa.org:52131 ESTABLISHED 30145/mysqld SERVER2: tcp0 0 wahooesc.sdcwa.org:52131www.sdcwa.org:mysql ESTABLISHED 30875/mysqld - I have try using the SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; I have also done these steps where in SERVER1 FLUSH TABLES WITH READ LOCK; SHOW MASTER STATUS; +--+--+--+--+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +--+--+--+--+ | mysql-bin.000289 | 42394063 | | | +--+--+--+--+ Then Dump SERVER1 database then you unlock SERVER1 database and copy it to SERVER2 then FLUSH TABLES WITH READ LOCK; I proceed to STOP SLAVE then add the database to SERVER2 then CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000289', MASTER_LOG_POS=42394063; to synch with the SERVER1 Then I start SERVER2 and the output of slave status is: mysql SHOW SLAVE STATUS\G *** 1. row *** Slave_IO_State: Waiting for master to send event Master_Host: 10.168.1.21 Master_User: sdcwa_slave Master_Port: 3306 Connect_Retry: 60 Master_Log_File: mysql-bin.000289 Read_Master_Log_Pos: 55848766 Relay_Log_File: mysql-relay-bin.02 Relay_Log_Pos: 13454938 Relay_Master_Log_File: mysql-bin.000289 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 55848766 Relay_Log_Space: 13454938 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 0 1 row in set (0.00 sec) --- I get the folllowing on my mysql.err: 121205 15:09:56 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000289' at position 42394063, relay log '/var/log/mysql/mysql-relay-bin.01' position: 4 121205 15:09:56 [Note] Slave I/O thread: connected to master ' sdcwa_slave@192.168.1.21:3306', replication started in log 'mysql-bin.000289' at position 42394063 Everything is GOOD, for a little while and then I get an error on mysql.err: - Now if I do the SKIP FLAG many times, I will error after error... I do not see how replication works so well for others if I am using the steps in the link on top of this message. THANKS!!! On Wed, Dec 5, 2012 at 3:42 AM, Manuel Arostegui man...@tuenti.com wrote: 2012/11/30 Néstor rot...@gmail.com I am trying to set up mysql replication on 2 systems but Once I get it going, I get the following an error 1062, skip I have re-installed the database on the slave also to see if this fixes the problem but after a few minutes I get the same error. I have repeated the replication from the beginning but I get the same problem after a while. Does anyone know a way to fix this? Hello, How did you build the slave from the master? How did you decide in which position the slave should start replicating from? You might want to try pt-table-checksum ( http://www.percona.com/doc/percona-toolkit/2.1/pt-table-checksum.html) to see what else do you have broken. Manuel. -- Manuel Aróstegui Systems Team tuenti.com
Re: MySQL Replication Error
I added those line to the slave's my.cnf and mysql would not start replicate-wild-ignore-table=parallax%.watchdog% replicate-wild-ignore-table=parallax%.cache% Nestor On Thu, Dec 6, 2012 at 4:39 PM, Néstor rot...@gmail.com wrote: HI Igor, Are you saying to add these lines to the my.cnf file: replicate-wild-ignore-table=dbname%.watchdog% replicate-wild-ignore-table=dbname%.cache% Correct? Thanks, Nestor :-) On Thu, Dec 6, 2012 at 3:07 PM, Igor Shevtsov nixofort...@gmail.comwrote: In regards to the second part of your email. You don't have errors in your mysql.err log. Those are notes saying that you started IO and SQL replication threads after you skipped an replication error and run start slave command. I wouldn't run SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; command either as it makes your tables inconsistent. I'd rather deleted offending row on the slave and started replication. In this case insert would've succeed and tables would become consistent again. On 06/12/12 21:59, Néstor wrote: I spoke to soon!!! Here is the error about 1.5 hours after replication has started. 121205 16:39:51 [ERROR] Slave: Error 'Duplicate entry '3468897' for key 1' on query. Default database: 'parallax'. Query: 'INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'page not found', 'images/internet_explorer/** borderTopLeft.png', 'N;', 4, '',' http://www.sdcwa.org/es/**images/internet_explorer/**borderTopLeft.pnghttp://www.sdcwa.org/es/images/internet_explorer/borderTopLeft.png', '', '10.20.141.24', 1354754352)', Error_code: 1062 121205 16:39:51 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with SLAVE START. We stopped at log 'mysql-bin.000289' position 86451409 --**-- Sorry for the long message, below are the steps use to create my replication. When I created the replication, I followed the steps here : http://crazytoon.com/2008/01/**29/mysql-how-do-you-set-up-** masterslave-replication-in-**mysql-centos-rhel-fedora/http://crazytoon.com/2008/01/29/mysql-how-do-you-set-up-masterslave-replication-in-mysql-centos-rhel-fedora/ I am on a red hat server. --- I set my firewall to accept info from server1 on server2 SERVER1: tcp0 0 wahoo.sdcwa.org:mysql wahooesc.sdcwa.org:52131 ESTABLISHED 30145/mysqld SERVER2: tcp0 0 wahooesc.sdcwa.org:52131www.sdcwa.org:mysql ESTABLISHED 30875/mysqld - I have try using the SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; I have also done these steps where in SERVER1 FLUSH TABLES WITH READ LOCK; SHOW MASTER STATUS; +--+--**+--+--**+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +--+--**+--+--**+ | mysql-bin.000289 | 42394063 | | | +--+--**+--+--**+ Then Dump SERVER1 database then you unlock SERVER1 database and copy it to SERVER2 then FLUSH TABLES WITH READ LOCK; I proceed to STOP SLAVE then add the database to SERVER2 then CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.**000289', MASTER_LOG_POS=42394063; to synch with the SERVER1 Then I start SERVER2 and the output of slave status is: mysql SHOW SLAVE STATUS\G *** 1. row *** Slave_IO_State: Waiting for master to send event Master_Host: 10.168.1.21 Master_User: sdcwa_slave Master_Port: 3306 Connect_Retry: 60 Master_Log_File: mysql-bin.000289 Read_Master_Log_Pos: 55848766 Relay_Log_File: mysql-relay-bin.02 Relay_Log_Pos: 13454938 Relay_Master_Log_File: mysql-bin.000289 Slave_IO_Running: Yes Slave_SQL_Running: Yes Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 55848766 Relay_Log_Space: 13454938 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: 0 1 row in set (0.00 sec) --- I get the folllowing on my mysql.err: 121205 15:09:56 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000289' at position 42394063, relay
Re: MySQL Replication Error
I was about to reply with a long message of all the steps I followed to create replication but I did my steps about an hour ago and I have not seen the replication fail so far. BTW, I created my replication following the info on this web page: http://crazytoon.com/2008/01/29/mysql-how-do-you-set-up-masterslave-replication-in-mysql-centos-rhel-fedora/ THANKS!!! Nestor On Wed, Dec 5, 2012 at 3:35 AM, Johan De Meersman vegiv...@tuxera.bewrote: - Original Message - From: divesh kamra kamra.div...@gmail.com slave-skip-errors=1062 --- in my.cnf and restart mysql Really? Just like that? Without even knowing what it does or what the problem is? If you have replication errors, this kind of stuff is only going to break it further. It exists is not an indication of fitness for any specific use, and that kind of option is really only for use in very very specific cases where you KNOW what's wrong and KNOW that it's not harmful in your highly specific situation. -- Linux Bier Wanderung 2012, now also available in Belgium! August, 12 to 19, Diksmuide, Belgium - http://lbw2012.tuxera.be -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
MySQL Replication Error
I am trying to set up mysql replication on 2 systems but Once I get it going, I get the following an error 1062, which is a duplicate entry and my 'slave status' shows: Slave_IO_Running: Yes Slave_SQL_Running: No And this is the error on my mysql.err file: 121130 12:41:53 [Note] Slave I/O thread killed while reading event 121130 12:41:53 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000266', position 76841310 121130 12:41:57 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000265' at position 99071761, relay log '/var/log/mysql/mysql-relay-bin.06' position: 98589371 121130 12:41:57 [Note] Slave I/O thread: connected to master ' sdcwa_slave@10.168.1.21:3306', replication started in log 'mysql-bin.000266' at position 76841310 121130 12:41:57 [ERROR] Slave: Error 'Duplicate entry 'links:primary-links:tree-data:7b7216a15969aa93e5dfb9aaa24bfc32' for key 1' on query. Default database: 'parallax'. Query: 'INSERT INTO cache_menu (cid, data, created, expire, headers, serialized) VALUES ('links:primary-links:tree-data:7b7216a15969aa93e5dfb9aaa24bfc32', 'a:2:{s:4:\tree\;a:19:{i:310;a:2:{s:4:\link\;a:38:{s:14:\load_functions\;s:26:\a:1:{i:1;s:9:\node_load\;}\;s:16:\to_arg_functions\;s:0:\\;s:15:\access_callback\;s:11:\node_access\;s:16:\access_arguments\;s:29:\a:2:{i:0;s:4:\view\;i:1;i:1;}\;s:13:\page_callback\;s:14:\node_page_view\;s:14:\page_arguments\;s:14:\a:1:{i:0;i:1;}\;s:5:\title\;s:0:\\;s:14:\title_callback\;s:15:\node_page_title\;s:15:\title_arguments\;s:14:\a:1:{i:0;i:1;}\;s:4:\type\;s:1:\4\;s:11:\description\;s:0:\\;s:9:\menu_name\;s:13:\primary-links\;s:4:\mlid\;s:3:\310\;s:4:\plid\;s:1:\0\;s:9:\link_path\;s:7:\node/14\;s:11:\router_path\;s:6:\node/%\;s:10:\link_title\;s:11:\Wh 121130 12:41:57 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with SLAVE START. We stopped at log 'mysql-bin.000265' position 99451408 I done searches on google and I look at several sites and basically they say to do the following: mysql stop slave; mysql SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; mysql start slave; mysql show slave status\G But after doing this a couple of minutes later I get the same situation I have re-installed the database on the slave also to see if this fixes the problem but after a few minutes I get the same error. I have repeated the replication from the beginning but I get the same problem after a while. Does anyone know a way to fix this? Thanks, Néstor
Re: MySQL Administrator Job Spain
Is 26K Euros enought money to live in Europe? On Thu, Oct 27, 2011 at 8:14 AM, Garcia, Monica monica.gar...@hays.eswrote: Hello people, We are looking for a MySQL DBA, based in Malaga (Spain). If you have 5+ years experience administering MySQL and you are interested in join an international company, please send your CV to: monica.gar...@hays.es. Salary from 40k and different employee benefits. I * Disclaimer This message (including any attachments) is confidential and may be legally privileged. If you are not the intended recipient, you should not disclose, copy or use any part of it. If you have received this email in error, please delete the email and any attachments immediately and notify the Hays plc group of companies (“Hays”) helpdesk at hsrsupp...@hays.com. Any information, statements or opinions contained in this message (including any attachments) are given by the author. They are not given on behalf of Hays unless subsequently confirmed by an individual other than the author who is duly authorised to represent Hays. Whilst all reasonable care has been taken to avoid the transmission of viruses, it is your responsibility as recipient to ensure that the opening or other use of this message and any attachments will not adversely affect your systems. Hays accepts no responsibility for damage caused by viruses and you should, therefore, carry out such virus and other checks as you consider appropriate. Hays plc is registered in England and Wales with company number 2150950. Hays plc’s registered office is at 250 Euston Road, London NW1 2AF. Opt Out (where applicable) Should you wish to opt out of receiving further information about our services, please email customerserv...@hays.com to unsubscribe or alternatively write to our Customer Helpline Team at the following address: Hays Specialist Recruitment Limited, 1st Floor Atlas House 173 Victoria Street London SW1E 5NA. To update your contact details or relevant information, please contact the sender. *
Re: DBA Mentor?
Calm down, There a many tutorials online. You do not need a tutor because when you ask a question here you will get many responses. You will get everyone here to help you. Start asking. Good luck, Nestor :-) On Wed, May 4, 2011 at 12:54 PM, Akachi Pictures purplefi...@hotmail.comwrote: GUYS. I NEVER ASKED TO PAY MONEY OR ASKED FOR TUTORING! GEEZ!
Re: DBA Mentor?
I did not see any messages about $20 Maybe the sender sent it to you only. Again, you got angry, take breath and ask your questions anytime. :-) On Wed, May 4, 2011 at 2:13 PM, Akachi Pictures purplefi...@hotmail.comwrote: No, not offended at all! Trust me, i'd much rather get no responses than a rather insulting remark as to soliciting training for $20. I mean, what is that??? I'm not naive, I get it. So there were absolutely no expecations on my part as far as having people jump up to offer. As I'm self-studying, i was listening to a career podcast and they suggested getting a mentor to bounce questions off of and get advice. So, i posted what i posted. that's it. sigh Chidiki Do what you love and you'll never work a day in your life. Date: Wed, 4 May 2011 16:19:40 -0400 From: rhi...@sympatico.ca To: purplefi...@hotmail.com Subject: Re: DBA Mentor? I hope you're not offended by the fact that no one jumped up to offer to be your mentor. Your request was perfectly polite and I'm sure no one was offended by it. The thing is that most of the people on this mailing list are working full time and have families and private lives. Also, I think they are concerned that you are looking for a big commitment of time. Expecting that kind of person to give up a lot of scarce personal time is just not very realistic. I'm sure you'll look back on this in a few years when you are working full time and have an active private life yourself and realize how much you are asking. In the meantime, feel free to post questions here and I'm sure people will help as best they can. But don't look for really long answers, even to big questions like how do I design a database?. You're much more likely to get a reference to a tutorial or a book than to have someone actually explain the process in detail. Most of us have bosses looking over our shoulder and simply can't take a lot of time to help someone to the level that a mentor typically does. Good luck to you! -- Rhino On 2011-05-04 15:54, Akachi Pictures wrote: GUYS. I NEVER ASKED TO PAY MONEY OR ASKED FOR TUTORING! GEEZ!
dash was converted o a wierd character
I have an sql file that I dump(mysqldump) and then I installed on a new system and some how the dashes on the file were changed to some wierd character. When I look at the sql file in my windows machine using PUTTY I get stuff like 1.01.A â the second When I look at the same file from my linux machine via ssh -y the I get stuff like 1.01.A – the second All I know is that this wierd character original was a dash (-) How can I search for this character and convert it to a dash? Thanks, Nestor :-)
HOW TO Backup a mysql innodb on windows?
Maybe one of you experts know the answer. I have a Innodb database that I want to back up. Is there a free tool to do this? mysqlhotbackup is a paid tool, is that the only one available? If I do a mysqldump of the innodb databse, will I be avail to uploaded into a myisam database and will it work? Thanks, Nestor
Re: HOW TO Backup a mysql innodb on windows?
Sorry, I meant to say that the backup DB does not look the same as the original DB. Maybe it has to do with what Todd and Mychael mentioned. The percona tool does not work on Windows OS. I could not find a windows executable. Thanks, Nestor :-) On Mon, Sep 14, 2009 at 9:13 AM, Néstor rot...@gmail.com wrote: I tried this but when I upload the backup it just does not look the same. Thanks, Nestor :- On Mon, Sep 14, 2009 at 8:04 AM, prathiman...@vsnl.net wrote: Use sqlyog its a freeware Sent from my BlackBerry® on Reliance Mobile, India's No. 1 Network. Go for it! -Original Message- From: Néstor rot...@gmail.com Date: Mon, 14 Sep 2009 07:44:25 To: mysql@lists.mysql.com Subject: HOW TO Backup a mysql innodb on windows? Maybe one of you experts know the answer. I have a Innodb database that I want to back up. Is there a free tool to do this? mysqlhotbackup is a paid tool, is that the only one available? If I do a mysqldump of the innodb databse, will I be avail to uploaded into a myisam database and will it work? Thanks, Nestor
Re: HOW TO Backup a mysql innodb on windows?
I did it again and using sqlyog did work. I also found out that the tool that comes with mysql admin 1.1 also has a backup tool that works. Thanks to all, Nestor :-) On Mon, Sep 14, 2009 at 9:16 AM, Néstor rot...@gmail.com wrote: Sorry, I meant to say that the backup DB does not look the same as the original DB. Maybe it has to do with what Todd and Mychael mentioned. The percona tool does not work on Windows OS. I could not find a windows executable. Thanks, Nestor :-) On Mon, Sep 14, 2009 at 9:13 AM, Néstor rot...@gmail.com wrote: I tried this but when I upload the backup it just does not look the same. Thanks, Nestor :- On Mon, Sep 14, 2009 at 8:04 AM, prathiman...@vsnl.net wrote: Use sqlyog its a freeware Sent from my BlackBerry® on Reliance Mobile, India's No. 1 Network. Go for it! -Original Message- From: Néstor rot...@gmail.com Date: Mon, 14 Sep 2009 07:44:25 To: mysql@lists.mysql.com Subject: HOW TO Backup a mysql innodb on windows? Maybe one of you experts know the answer. I have a Innodb database that I want to back up. Is there a free tool to do this? mysqlhotbackup is a paid tool, is that the only one available? If I do a mysqldump of the innodb databse, will I be avail to uploaded into a myisam database and will it work? Thanks, Nestor
Re: HOW TO Backup a mysql innodb on windows?
I tried this but when I upload the backup it just does not look the same. Thanks, Nestor :- On Mon, Sep 14, 2009 at 8:04 AM, prathiman...@vsnl.net wrote: Use sqlyog its a freeware Sent from my BlackBerry® on Reliance Mobile, India's No. 1 Network. Go for it! -Original Message- From: Néstor rot...@gmail.com Date: Mon, 14 Sep 2009 07:44:25 To: mysql@lists.mysql.com Subject: HOW TO Backup a mysql innodb on windows? Maybe one of you experts know the answer. I have a Innodb database that I want to back up. Is there a free tool to do this? mysqlhotbackup is a paid tool, is that the only one available? If I do a mysqldump of the innodb databse, will I be avail to uploaded into a myisam database and will it work? Thanks, Nestor
DB/table problem
I am running mysql 5.0 on a windows 2003 host with php and apache I am trying to restore a database from 08/28/2009. The backup is done by windows and all I do is copy the data/scroller612 folder to the DATA folder in the MYSQL directory. when I restore/copy it I get the following errors my .err file found on the data directory: == 090910 11:04:03090910 11:04:03 [ERROR] Cannot find table scroller612/cache from the internal data dictionary of InnoDB though the .frm file for the table exists. Maybe you have deleted and recreated InnoDB data files but have forgotten to delete the corresponding .frm files of InnoDB tables, or you have moved .frm files to another database? See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html how you can resolve the problem. = When I go to the above link it saids to run the check table statement, but when I do this, I get below response: === mysql check table scroller612.access; ++---+ --+--+ | Table | Op| Msg_type | Msg_text | ++---+--+--+ | scroller612.access | check | Error| Table 'scroller612.access' doesn't exist | | scroller612.access | check | error| Corrupt | ++---+--+--+ 2 rows in set (0.00 sec) It says that the table is corrupt. I can actually log into mysql and see the list of tables, but I can NOT desc or select the tables. how do I restore the back up? Do I need to remove the .frm files , but that would kill my data. Thanks, Nestor :-)
Re: DB/table problem
OK, All I have then is a bunch of .frm files. Can I recover the data from the FRM files if I install mysql 5.0 without INNODB? Thanks, On Thu, Sep 10, 2009 at 2:49 PM, Gavin Towey gto...@ffn.com wrote: When using innodb, your data is stored in the data/ibdata* files. Copying the database directory is not a valid backup. In the future, I would suggest using mysqldump. However if you want to make a file-system copy backup with innodb you need to 1. Shutdown the server 2. Copy *everything* in the data directory 3. Store a copy of your my.ini with the backup as well. 4. Restart mysql Regards, Gavin Towey -Original Message- From: Néstor [mailto:rot...@gmail.com] Sent: Thursday, September 10, 2009 11:28 AM To: mysql@lists.mysql.com Subject: DB/table problem I am running mysql 5.0 on a windows 2003 host with php and apache I am trying to restore a database from 08/28/2009. The backup is done by windows and all I do is copy the data/scroller612 folder to the DATA folder in the MYSQL directory. when I restore/copy it I get the following errors my .err file found on the data directory: == 090910 11:04:03090910 11:04:03 [ERROR] Cannot find table scroller612/cache from the internal data dictionary of InnoDB though the .frm file for the table exists. Maybe you have deleted and recreated InnoDB data files but have forgotten to delete the corresponding .frm files of InnoDB tables, or you have moved .frm files to another database? See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html how you can resolve the problem. = When I go to the above link it saids to run the check table statement, but when I do this, I get below response: === mysql check table scroller612.access; ++---+ --+--+ | Table | Op| Msg_type | Msg_text | ++---+--+--+ | scroller612.access | check | Error| Table 'scroller612.access' doesn't exist | | scroller612.access | check | error| Corrupt | ++---+--+--+ 2 rows in set (0.00 sec) It says that the table is corrupt. I can actually log into mysql and see the list of tables, but I can NOT desc or select the tables. how do I restore the back up? Do I need to remove the .frm files , but that would kill my data. Thanks, Nestor :-) The information contained in this transmission may contain privileged and confidential information. It is intended only for the use of the person(s) named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
Re: Oracle , what else ?
It will great if the MYSQL guys were to buy mysql from Oracle for half the price that Sun paid. They would come out making lots of money and back controlling their own destiny. :-) On Tue, Apr 21, 2009 at 4:47 PM, Arthur Fuller fuller.art...@gmail.comwrote: I hereby bet the farm that this shall not occur. I have $10 to say that this shall not occur. a) Who is going to challenge the deal? b) What possible purpose would it serve to interr MySQL? c) Assuming there is some reason for b) above, why incur the wrath of the MySQL community and their possible bail-outs? Nothing gained and everything lost, in such a move. d) If we know anything, we know that Scott and Larry are not fools. e) In the grand scheme of things, the MySQL piece of this pie is peanuts and perhaps less. This acquisition is about the big picture (hardware platform + existing Sparc base + Java, etc.). MySQL, as much as we love it, is a tiny teensy part of this acquisition, and my guess is that Scott and Larry are much more focussed on the other parts (e.g. end-to-end solutions extending from the hardware to the middleware to the Oracle apps, etc.) and in this ballpark MySQL is an interesting tidbit but not at all the focus of their efforts. Think big, baby. MySQL in this context is a tiny little ripple in the pond, having little or nothing to do with Scott/Larry's plans. Viewed from this perspective, MySQL becomes a viable alternative to such offerings as SQL Express from MS. If for no other reasons than marketing imperatives, I am confident that Scott and Larry will choose not to kill MySQL but rather regard it as both an entry platform and a position from which to upgrade to Oracle. Make no mistake about this. There are very sound reasons to upgrade to Oracle. Cost is of course a serious issue. But Oracle can do things, and has various top-end vehicles, that MySQL cannot approach. Consider, to take just one example, Trusted Oracle, upon which numerous banks bet their bottom dollar. Add to this the numerous Oracle Apps. I am no champion of Oracle in particular, but I do rtheecognize what platforms X and Y can do. If the game is defined as retrieval amongst several GB of data, then MySQL has a chance. If the game is retrieval amongst several PB of data, with security, then I bet on Oracle. Granted, this move requires a team of DBAs etc., but if you are dealing with PetaBytes then I suggest that you think carefully about which vendor is prepared to take you there. Just my $0.02 in this debate. I don't see MySQL and Oracle as competitive products. In fact I see the opposite: Oracle gets to occupy a space in the open-source community while simultanwously offering an upgrade path to multi-petabyte solutions, serious security, and so on. I don't think that Scott and Larry are out to hurt the MySQL community, and I'm prepared to bet that they will invest in the next version of MySQL, You might disagree but I challenge you to answer Why? Sheer rapaciousness? That doesn't make sense. MySQL has garnered numerous big-time players, and in what possible interest would Oracle jeapordize these investments? As several writers on this thread have said, if Oracle muddies the waters then they are prepared to move to PostGres and/or several other alternatives, not least to take the MySQL sources to a new playpen. It is clearly not in the interests of Oracle to let this happen. Far more interesting is to fold the MySQL project into Oracle's overall Linux project. Continue to offer MySQL for free, work on transport vehicles that let MySQL people migrate effortlessly to Oracle, etc. I don't mean to pretend to read Scott and Larry's minds here. But I think that the MySQL part of this acquisition, while interesting, is a small part of the rationale for buying Sun. The serious interest is in acquiring an end-to-end solution, as yet offered by nobody, including IBM and MS. This is the most significant part of this acquisition. Imagine being the salesperson of said stack. We have the hardware and the operating system and the middleware and the front-end. Click and go. IMO this is a truly formidable argument. In practice, it could be delivered as an appliance and/or a blade. And if you don't think this is formidable, then wake up and smell the coffee. This could well leap-frog certain other competitors -- which is not to say they won't catch up eventually, but it is to say that Oracle has raised the bar and it's time for competitors such as MS to jump through several flaming hoops. On Tue, Apr 21, 2009 at 6:57 PM, John Daisley john.dais...@mypostoffice.co.uk wrote: MySQL will live on regardless of who owns the brand. First and foremost MySQL is a community and that community will continue to develop MySQL and take it in the direction they want it to go. Sure Oracle could try and force some 'features' or changes through but if the community didn't like them the community
Help with query
I have a char fiel where I am keeping dates formatted as year-month-day (2006-10-09) Now I am trying to find all the records between 2 strings (2 dates). The 2 queries below should return the same number of records by they do not. My query is this: SELECT COUNT(*) FROM proj where proj_archive=0 AND (proj_adv_date = '2008-01-01' AND proj_adv_date '2008-12-16') order by proj_type, proj_adv_date, proj_bid_date, proj_name ASC; +-+---+ | proj_id | proj_adv_date | +-+---+ | 181 | 2008-11-25| | 217 | 2008-10-27| | 136 | 2008-12-01| | 219 | 2008-12-08| | 225 | 2008-12-11| +-+---+ 5 rows in set (0.00 sec) I get only 5 records returned but if I do this query: SELECT COUNT(*) FROM proj where proj_archive=0 AND (proj_adv_date '2008-01-01') order by proj_type, proj_adv_date, proj_bid_date, proj_name ASC; +-+---+ | proj_id | proj_adv_date | +-+---+ | 181 | 2008-11-25| | 221 | 2008-12-23| | 108 | 2009-01-00| | 173 | 2009-03-00| | 149 | 2009-10-00| | 143 | 2009-7-00 | | 179 | 2010-04-00| | 217 | 2008-10-27| | 136 | 2008-12-01| | 219 | 2008-12-08| | 225 | 2008-12-11| | 187 | 2009-01-00| | 199 | 2009-01-01| | 177 | 2009-02-01| | 69 | 2009-03-00| | 70 | 2009-03-00| | 71 | 2009-03-00| | 142 | 2009-03-00| | 122 | 2009-04-00| | 124 | 2009-04-00| | 207 | 2009-04-01| | 72 | 2009-07-00| | 73 | 2009-07-00| | 82 | 2009-07-00| | 209 | 2009-10-01| | 211 | 2009-10-01| | 213 | 2010-03-01| +-+---+ 27 rows in set (0.00 sec) thanks, Rotsen :-)
Re: Help with query
Sorry!!! I apoligized for being blind. Yes, in my small mind I was thinking that I do not have records biggeer than 2008 but I do and my mind refused to see the records for 2009 and 2010. Sorry again for being so blind to the obvious. :-( On Mon, Dec 15, 2008 at 9:50 AM, Phil freedc@gmail.com wrote: Am I totally missing something? Why do you believe the two queries should return the same # of rows? First one has a qualification of proj_adv_date '2008-12-16' whilst the second one does not... On Mon, Dec 15, 2008 at 12:12 PM, Néstor rot...@gmail.com wrote: I have a char fiel where I am keeping dates formatted as year-month-day (2006-10-09) Now I am trying to find all the records between 2 strings (2 dates). The 2 queries below should return the same number of records by they do not. My query is this: SELECT COUNT(*) FROM proj where proj_archive=0 AND (proj_adv_date = '2008-01-01' AND proj_adv_date '2008-12-16') order by proj_type, proj_adv_date, proj_bid_date, proj_name ASC; +-+---+ | proj_id | proj_adv_date | +-+---+ | 181 | 2008-11-25| | 217 | 2008-10-27| | 136 | 2008-12-01| | 219 | 2008-12-08| | 225 | 2008-12-11| +-+---+ 5 rows in set (0.00 sec) I get only 5 records returned but if I do this query: SELECT COUNT(*) FROM proj where proj_archive=0 AND (proj_adv_date '2008-01-01') order by proj_type, proj_adv_date, proj_bid_date, proj_name ASC; +-+---+ | proj_id | proj_adv_date | +-+---+ | 181 | 2008-11-25| | 221 | 2008-12-23| | 108 | 2009-01-00| | 173 | 2009-03-00| | 149 | 2009-10-00| | 143 | 2009-7-00 | | 179 | 2010-04-00| | 217 | 2008-10-27| | 136 | 2008-12-01| | 219 | 2008-12-08| | 225 | 2008-12-11| | 187 | 2009-01-00| | 199 | 2009-01-01| | 177 | 2009-02-01| | 69 | 2009-03-00| | 70 | 2009-03-00| | 71 | 2009-03-00| | 142 | 2009-03-00| | 122 | 2009-04-00| | 124 | 2009-04-00| | 207 | 2009-04-01| | 72 | 2009-07-00| | 73 | 2009-07-00| | 82 | 2009-07-00| | 209 | 2009-10-01| | 211 | 2009-10-01| | 213 | 2010-03-01| +-+---+ 27 rows in set (0.00 sec) thanks, Rotsen :-) -- Distributed Computing stats http://stats.free-dc.org
Re: MySQL Master Slave Replication
Kaushal, I will try it tomorrow to see if it works. It is similar to something I tried a couple of weeks ago and it work but when I changed the ip address it stop working. I will try this tomorrow and let you know. Néstor :-) On Sun, Apr 6, 2008 at 10:52 PM, Kaushal Shriyan [EMAIL PROTECTED] wrote: hi is this a correct documentation http://howtoforge.com/mysql_master_master_replication for Master Slave Replication Thanks and Regards Kaushal -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Fwd: MySQL Master Slave Replication
Kaushal, That worked. I found out that my problem was that my firewall was not allowing my to computers to talk to each other on port 3306. I use the link you sent but this are th eoriginal links I used: 1) Master/Slave replication http://crazytoon.com/2008/01/29/mysql-how-do-you-set-up-masterslave-replication-in-mysql-centos-rhel-fedora/ 2) Master/Master replication http://crazytoon.com/2008/02/29/mysql-how-do-you-set-up-mastermaster-replication-in-mysql-centos-rhel-fedora/ Thanks, Néstor :-) On Sun, Apr 6, 2008 at 11:28 PM, Kaushal Shriyan [EMAIL PROTECTED] wrote: On Mon, Apr 7, 2008 at 11:32 AM, Néstor [EMAIL PROTECTED] wrote: Kaushal, I will try it tomorrow to see if it works. It is similar to something I tried a couple of weeks ago and it work but when I changed the ip address it stop working. I will try this tomorrow and let you know. Néstor :-) On Sun, Apr 6, 2008 at 10:52 PM, Kaushal Shriyan [EMAIL PROTECTED] wrote: hi is this a correct documentation http://howtoforge.com/mysql_master_master_replication for Master Slave Replication Thanks and Regards Kaushal -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] Hi Nestor Thanks for the quick reply My requirement was if the Master goes down, the slave should take care and act as Master. the Master should acts as slave and reversing of this role. is this possible. Thanks and Regards Kaushal
Re: MySQL Master Slave Replication
Kaushal, When you set it to MASTER/MASTER replication then everything that happens on the MASTER happens on the SLAVE. Remember they are both master and slave. My situation is as fallows, I have 2 node (servers) and I have then configured for HA (high availability) failover. When node 1 goes down, node 2 takes over and when node 1 comes back up then node 1 will becomes the main node. For this I am using RHEL cluster suite but you could set up HEARTBEAT to handle the High Availability, see ha-linux.org The above is separate\ from my replication. The DB replication is handled by mysql by following the process explained on the links. Take care, Néstor :-) On Mon, Apr 7, 2008 at 11:44 AM, Kaushal Shriyan [EMAIL PROTECTED] wrote: On Tue, Apr 8, 2008 at 12:02 AM, Néstor [EMAIL PROTECTED] wrote: Kaushal, That worked. I found out that my problem was that my firewall was not allowing my to computers to talk to each other on port 3306. I use the link you sent but this are th eoriginal links I used: 1) Master/Slave replication http://crazytoon.com/2008/01/29/mysql-how-do-you-set-up-masterslave-replication-in-mysql-centos-rhel-fedora/ 2) Master/Master replication http://crazytoon.com/2008/02/29/mysql-how-do-you-set-up-mastermaster-replication-in-mysql-centos-rhel-fedora/ Thanks, Néstor :-) On Sun, Apr 6, 2008 at 11:28 PM, Kaushal Shriyan [EMAIL PROTECTED] wrote: On Mon, Apr 7, 2008 at 11:32 AM, Néstor [EMAIL PROTECTED] wrote: Kaushal, I will try it tomorrow to see if it works. It is similar to something I tried a couple of weeks ago and it work but when I changed the ip address it stop working. I will try this tomorrow and let you know. Néstor :-) On Sun, Apr 6, 2008 at 10:52 PM, Kaushal Shriyan [EMAIL PROTECTED] wrote: hi is this a correct documentation http://howtoforge.com/mysql_master_master_replication for Master Slave Replication Thanks and Regards Kaushal -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] Hi Nestor Thanks for the quick reply My requirement was if the Master goes down, the slave should take care and act as Master. the Master should acts as slave and reversing of this role. is this possible. Thanks and Regards Kaushal Hi Nestor My requirement was if the Master goes down, the slave should take care and act as Master. the Master should acts as slave and reversing of this role.is it possible Also what are the test cases which you followed while doing the Master Slave Replication setup. Thanks and Regards Kaushal
MySQL MASTER/MASTER REPLICATION
In my RHEL5, I am using this link to create MySQL replication an did work the first time I did it: http://crazytoon.com/2008/02/29/mysql-how-do-you-set-up-mastermaster-replication-in-mysql-centos-rhel-fedora/ I change the ip address and the hostname and it is not working now. My new ip is 10.100.1.170 and my hostname is wahoo1. The other ip address in my master/master replication is 10.100.1.171 and wahoo2 *This is what wahoo1 my.cnf looks like*: [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock old_passwords=1 auto_increment_increment=2 auto_increment_offset=1 relay-log=wahoo1-relay-bin log-bin=wahoo1-bin binlog-ignore-db=mysql binlog-ignore-db=test server-id = 1 master-host = 10.100.1.171 master-user = slaveuser master-password = slavepw master-port = 3306 [mysql.server] user=mysql basedir=/var/lib [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid *This is what wahoo2 my.cnf looks like:* [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock old_passwords=1 auto_increment_increment=2 auto_increment_offset=2 relay-log=wahoo2-relay-bin log-bin=wahoo2-bin binlog-ignore-db=mysql binlog-ignore-db=test server-id = 2 master-host = 10.100.1.170 master-user = slaveuser master-password = slavepw master-port = 3306 [mysql.server] user=mysql basedir=/var/lib [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid *This is the error I get on my mysqld.log file*: 080401 15:15:07 [Note] Slave SQL thread initialized, starting replication in log 'FIRST' at position 0, relay log './wahoo2-relay-bin.02' position: 98 080401 15:15:07 [ERROR] Slave I/O thread: error connecting to master ' [EMAIL PROTECTED]:3306': Error: 'Lost connection to MySQL server during query' errno: 2013 retry-time: 60 retries: 86400 HELP! Thanks, Néstor :-)
Re: MySQL MASTER/MASTER REPLICATION
YEs, both of MySQL are running on each system. Show status display a big long list of items, any specific? uptime is 3239 on 10.100.1.170 uptime is 3353 on 10.100.1.171 Thanks, Néstor :-) On Tue, Apr 1, 2008 at 3:46 PM, Srini [EMAIL PROTECTED] wrote: is your mysql running on the master host i,e 10.100.1.170 Also can you please execute show status on that host to see how long the server is up, may be the server is restarted and your slave is retrying on the same old connection HTH, -srini Néstor wrote: In my RHEL5, I am using this link to create MySQL replication an did work the first time I did it: http://crazytoon.com/2008/02/29/mysql-how-do-you-set-up-mastermaster-replication-in-mysql-centos-rhel-fedora/ I change the ip address and the hostname and it is not working now. My new ip is 10.100.1.170 and my hostname is wahoo1. The other ip address in my master/master replication is 10.100.1.171 and wahoo2 *This is what wahoo1 my.cnf looks like*: [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock old_passwords=1 auto_increment_increment=2 auto_increment_offset=1 relay-log=wahoo1-relay-bin log-bin=wahoo1-bin binlog-ignore-db=mysql binlog-ignore-db=test server-id = 1 master-host = 10.100.1.171 master-user = slaveuser master-password = slavepw master-port = 3306 [mysql.server] user=mysql basedir=/var/lib [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid *This is what wahoo2 my.cnf looks like:* [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock old_passwords=1 auto_increment_increment=2 auto_increment_offset=2 relay-log=wahoo2-relay-bin log-bin=wahoo2-bin binlog-ignore-db=mysql binlog-ignore-db=test server-id = 2 master-host = 10.100.1.170 master-user = slaveuser master-password = slavepw master-port = 3306 [mysql.server] user=mysql basedir=/var/lib [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid *This is the error I get on my mysqld.log file*: 080401 15:15:07 [Note] Slave SQL thread initialized, starting replication in log 'FIRST' at position 0, relay log './wahoo2-relay-bin.02' position: 98 080401 15:15:07 [ERROR] Slave I/O thread: error connecting to master ' [EMAIL PROTECTED]:3306': Error: 'Lost connection to MySQL server during query' errno: 2013 retry-time: 60 retries: 86400 HELP! Thanks, Néstor :-)
Re: Need help creating query statement
Guys, just wanted to thank you again for helping me with the sql statement that I needed. I was able to sorted using php and I was able to display the correct result. Thanks again!!1 Nestor :-) On Nov 6, 2007 7:37 AM, Néstor [EMAIL PROTECTED] wrote: You guys are correct, that is exactly what happened. I must thing of this in the future. At this moment I have a lot of other projects to take care, that it is eaiser for me to read the information into an associative array with the columns and the values and sort the array and then print the top 5 values within each array. Thanks, Nestor :-) On 11/6/07, Enrique Sanchez Vela [EMAIL PROTECTED] wrote: --- [EMAIL PROTECTED] wrote: Néstor wrote: I think you'd best begin by normalising your database. Something along these lines: very true indeed, that would save you major headaches when right after finishing the demo, someone would say, can we add a 18 gallon pledge? what about a 25? as of the sort of columns per row, I believe it is not possible nor in the goals of MySQL to make it possible/easy. best regards, enrique. -- What you have been obliged to discover by yourself leaves a path in your mind which you can use again when the need arises.--G. C. Lichtenberg http://themathcircle.org/ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Need help creating query statement
You guys are correct, that is exactly what happened. I must thing of this in the future. At this moment I have a lot of other projects to take care, that it is eaiser for me to read the information into an associative array with the columns and the values and sort the array and then print the top 5 values within each array. Thanks, Nestor :-) On 11/6/07, Enrique Sanchez Vela [EMAIL PROTECTED] wrote: --- [EMAIL PROTECTED] wrote: Néstor wrote: I think you'd best begin by normalising your database. Something along these lines: very true indeed, that would save you major headaches when right after finishing the demo, someone would say, can we add a 18 gallon pledge? what about a 25? as of the sort of columns per row, I believe it is not possible nor in the goals of MySQL to make it possible/easy. best regards, enrique. -- What you have been obliged to discover by yourself leaves a path in your mind which you can use again when the need arises.--G. C. Lichtenberg http://themathcircle.org/ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Need help creating query statement
I can do simple select statements but I need your brains to create query statment. I am using mysql 4.0 in my 1and1 site. I have a table that has 8 fields, one is the agency field and the other 7 are *tip* values on saving water and the value of this field is either 0 or an amount. -- |agency| 5g | 8g | 10g | 12g | 15g | 20g | 40g | -- so the record could be |Helix | 0 | 8 | 10 | 12 | 15 | 0 | 40 | |Corp| 5 | 0 | 0 | 12 | 15 | 0 |0 | |Helix | 0 | 8 | 10 | 0 | 15 | 0 | 40 | I need to get the to count *tips* per *agency *so in this case of 3 records I would have: |Helix | 0 | 2 | 2 |1 | 2 | 0 | 2 | |Corp |1 | 0 | 0 |1 |1 |0 |0 | and then I need to come out with top 5 *tips *per agency |Helix | 8g = 2 | 10g = 2 | 15g = 2 | 8g = 2 | 40g = 2| |Corp| 8g = 1 | 12g = 1 | 15g= 1 | Is there an easy way to do this? I hope I made myself understood. Thanks, Néstor :-)
Need help to create a query
I have a table with about 9 fields, and record ID field an agency name field and the # of gallons that a erson pledges to save: -- |ID| agency| 5g | 8g | 10g | 12g | 15g | 18g | 20g | --- Each of the gallon fields are either a 0 or the # of gallons for that column: |1 | Helix | 0 | 8 | 10 | 0 | 15 | 0 | 0 | |2 | corp | 5 | 8 | 0 | 12 | 15 | 18 | 20 | |3 | Helix | 5 | 8 | 10 | 0 | 15 | 0 | 20 | |4 | Helix | 5 | 8 | 10 | 0 | 15 | 0 | 0 | |5 | corp | 5 | 0 | 0 | 12 | 15 | 0 | 20 | I need to be able to obtain the top 5 pledges per agency: | Helix |8g = 3|10g =3 |15g = 3 |5g = 2 |20g = 2 | | Corp |5g = 2 | 12g = 2 |15g = 2 | 20g = 2| 8g = 1| Thanks, Nestor :-)
Re: Need help creating query statement
Enrique that is pretty good and close to what I need. On top of what you have generously provide, I guess I can just put each gallon field into an array an then sort the array to display the first 5 gallon fields per agency. Is there an easier way? Thanks, Nestor :-) On 11/5/07, Enrique Sanchez Vela [EMAIL PROTECTED] wrote: --- Néstor [EMAIL PROTECTED] wrote: I can do simple select statements but I need your brains to create query statment. I am using mysql 4.0 in my 1and1 site. I have a table that has 8 fields, one is the agency field and the other 7 are *tip* values on saving water and the value of this field is either 0 or an amount. -- |agency| 5g | 8g | 10g | 12g | 15g | 20g | 40g | -- so the record could be |Helix | 0 | 8 | 10 | 12 | 15 | 0 | 40 | |Corp| 5 | 0 | 0 | 12 | 15 | 0 | 0 | |Helix | 0 | 8 | 10 | 0 | 15 | 0 | 40 | I need to get the to count *tips* per *agency *so in this case of 3 records I would have: |Helix | 0 | 2 | 2 |1 | 2 | 0 | 2 | |Corp |1 | 0 | 0 |1 |1 |0 | 0 | let's see if I got the point CREATE TABLE `agency` ( `name` varchar(11) collate latin1_bin NOT NULL default '', `5g` int(11) NOT NULL default '0', `8g` int(11) NOT NULL default '0', `10g` int(11) NOT NULL default '0', `12g` int(11) NOT NULL default '0', `15g` int(11) NOT NULL default '0', `20g` int(11) NOT NULL default '0', `40g` int(11) NOT NULL default '0' ) ENGINE=MyISAM ; select * from agency; +---+++-+-+-+-+-+ | name | 5g | 8g | 10g | 12g | 15g | 20g | 40g | +---+++-+-+-+-+-+ | Helix | 0 | 0 | 0 | 12 | 0 | 0 | 0 | | Helix | 0 | 8 | 10 | 0 | 15 | 0 | 40 | | Corp | 5 | 0 | 0 | 12 | 15 | 0 | 40 | | Helix | 0 | 8 | 10 | 0 | 15 | 0 | 40 | +---+++-+-+-+-+-+ 4 rows in set (0.00 sec) select `name`, sum(if(5g0, 1,0)) as 5g , sum(if(8g0, 1,0)) as 8g, sum(if(10g0,1,0)) as 10g, sum(if(12g0,1,0))as 12g ,sum(if(15g0,1,0)) as 15g , sum(if (20g0,1,0)) as 20g, sum(if(40g0,1,0)) as 40g from agency group by `name`; produces... +---+--+--+--+--+--+--+--+ | name | 5g | 8g | 10g | 12g | 15g | 20g | 40g | +---+--+--+--+--+--+--+--+ | Corp |1 |0 |0 |1 |1 |0 | 1 | | Helix |0 |2 |2 |1 |2 |0 | 2 | +---+--+--+--+--+--+--+--+ 2 rows in set (0.00 sec) regards, esv. -- What you have been obliged to discover by yourself leaves a path in your mind which you can use again when the need arises.--G. C. Lichtenberg http://themathcircle.org/ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Can't fetch result twice in a PHP script
mysql_num_rows() http://www.php.net/manual/en/ref.mysql.php :-) On 9/15/07, Chris W [EMAIL PROTECTED] wrote: Mahmoud Badreddine wrote: it is more of a PHP question , I admit. I tried mysql_fetch_array, mysql_data_seek, mysql_result . Same result. And I am sure there's more than zero rows to be fetched, because it works in the first call, but not the second. That just means there is one row in the result and only one row. you should really print the query and then execute it using some other tool to see the result, I would be willing to bet there is only one row in the result. An error that has caught me more than once is having another query inside the look and using the same result variable. -- Chris W KE5GIX Protect your digital freedom and privacy, eliminate DRM, learn more at http://www.defectivebydesign.org/what_is_drm; Gift Giving Made Easy Get the gifts you want give the gifts they want One stop wish list for any gift, from anywhere, for any occasion! http://thewishzone.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL Magazine - Issue 1 available NOW!!!!
Can you explain what each of those lines do? Thanks, Nestor PS Great work on the mysql article On 6/4/07, Daevid Vincent [EMAIL PROTECTED] wrote: Thanks for the magazine. I already incorporated a little extra SQL injection checking into my db.inc.php wrapper... //[dv] added to remove all comments (which may help with SQL injections as well. $sql = preg_replace(/#.*?[\r\n]/s, '', $sql); $sql = preg_replace(/--.*?[\r\n]/s, '', $sql); $sql = preg_replace(@/\*(.*?)\*/@s, '', $sql); Keep up the great work! d -Original Message- From: B. Keith Murphy [mailto:[EMAIL PROTECTED] Sent: Monday, June 04, 2007 9:56 AM To: MySQL General Subject: MySQL Magazine - Issue 1 available NOW Everyone, I have just uploaded the first issue MySQL Magazine to http://paragon-cs.com/mag/issue1.pdf Please take a look at it. There is a great deal of information here and I think it is worth some time. Feedback is always welcome. thanks, Keith Murphy -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL Daylight Savings Time Patch - easy check
That was interesting. I have 2 rhel 3 servers and they both have been update to handle the DST. They both yield different results when I ran the command: SERVER=RALPH +---+---+ | UNIX_TIMESTAMP('2007-03-11 02:00:00') | UNIX_TIMESTAMP('2007-03-11 03:00:00') | +---+---+ | 1173607200 | 1173610800 | +---+--- and this for the other server : SERVER=MAGGIE +---+---+ | UNIX_TIMESTAMP('2007-03-11 02:00:00') | UNIX_TIMESTAMP('2007-03-11 03:00:00') | +---+---+ |1173607200 | 1173607200 | +---+--- Uhm. Nestor On 2/28/07, William R. Mussatto [EMAIL PROTECTED] wrote: On Wed, February 28, 2007 14:10, Ryan Stille said: I am on 4.1.20-1. Maybe your OS isn't patched? Try this: SELECT @@global.time_zone; Won't help if you are on debian which is still on 4.0. If you get back SYSTEM, then MySQL is looking to the OS for timezone data. And its only loaded when MySQL starts, so if you haven't restarted MySQL since you patched your OS, you need to do that. -Ryan Jerry Schwartz wrote: What version of MySQL are you using? I'm running 4.1.21, and that check doesn't work even after I've updated (I think) the time zone tables. I should probably eyeball the output of mysql_tzinfo_to_sql. Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 -Original Message- From: Ryan Stille [mailto:[EMAIL PROTECTED] Sent: Saturday, February 24, 2007 4:28 PM To: mysql@lists.mysql.com Subject: Re: MySQL Daylight Savings Time Patch - easy check Ryan Stille wrote: Paul DuBois wrote: At 4:40 PM -0600 2/20/07, Ryan Stille wrote: Is there an easy way to test to see if MySQL already has the proper tables loaded? -Ryan Yes, reload them. :-) After that, they're current! ... After digging around on the net for a while I found an easy way to tell if your MySQL installation is ready for the new daylight savings time. SELECT UNIX_TIMESTAMP('2007-03-11 02:00:00'), UNIX_TIMESTAMP('2007-03-11 03:00:00'); This should return the same value, even though you are feeding it different times, because this is when the 1 hr change occurs. I get the correct result on both of my machines. On one of them I've run the suggested |mysql_tzinfo_to_sql command, on the other, the time zone tables are completely empty! Any wisdom on these time zone tables - are they ever used, should I populate them or not? -Ryan | -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Converting a field or converting a date?
People, I am not very savy with SQL and I need help. I have a char field that contains a date and the date is in DD-MM- and I want to sort it but the sort is wrong because 01-04-2007 comes out before 10-22-2006. Is there an easy way to provide a correct sorted output list or do I need to edit my table and convert all my fields to -MM-DD before I can sort it. Any help is welcome. Thanks, Néstor :-)