Re: SELECT with Result Ordered by Minimum of Fields
David T. Ashley wrote: Can I just write something like: SELECT * FROM mytable WHERE fieldofinterestvalue ORDER BY MIN(field1, field2) ASC; I think this will work.. SELECT *, IF(a-b 0,a, b) as SortField FROM table WHERE whatever ORDER BY SortField a and b being the names of the fields you are interested in. -- Chris W KE5GIX 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]
Error 1032 : Can't find Record in table
Hello, I'm curently testing partitioning with mysql 5.1.11 on linux (.rpm from mysql.com site). Table Structure: CREATE TABLE `adr-0` ( Adr varchar(255) COLLATE latin1_german1_ci NOT NULL DEFAULT '', Qty int(10) NOT NULL, PRIMARY KEY (Adr), ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci PARTITION BY KEY (Adr) PARTITIONS 10 ; Now I'm inserting data: insert into adr-0 values ('TestAdr','1') on duplicate key update qty = qty +1; This works fine until on duplicate key triggers. Then I receive the error message: 1032: Can't find record in adr-0 When I'm doing the same on a non-partitioned table, everything work as expected. I haven't found any limitations of the partitioning in the manual, which could be the reason. Is this a bug or a feature ? Thanks in advance for any help ! Detlev -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Problems connecting using -h hostname with new installation
Hello, I installed MySQL on a remote server and am having a problem. I am connected to it via SSH and I can do mysql -u root -h localhost just fine and connect. However, when I try to connect via mysql -u root -h web1.server.com, I get the following message: ERROR 1130 (0): Host '75.120.X.X' is not allowed to connect to this MySQL server Now the server's hostname is web1.server.com and it resolves to 75.120.X.X fine so I know it's not an issue with that. Does anyone have any clues why? I have a web1.server.com added in the mysq.user table so I know that's not the problem. If I add 75.120.X.X to the mysql.user table, I am able to connect via mysql -u root -h web1.server.com just fine. But why won't it work when web1.server.com is in the mysql.user table? Thanks for any help. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: SELECT with Result Ordered by Minimum of Fields
On 8/6/06, Chris W [EMAIL PROTECTED] wrote: David T. Ashley wrote: Can I just write something like: SELECT * FROM mytable WHERE fieldofinterestvalue ORDER BY MIN(field1, field2) ASC; I think this will work.. SELECT *, IF(a-b 0,a, b) as SortField FROM table WHERE whatever ORDER BY SortField Question: Is there any way to get SortField (or a similar per-selected-record field) included with the SELECT output? The reason for this inquiry is that my PHP script that uses the SELECT results will also have to calculate SortField as MySQL did as part of the query. If MySQL has done it already, no need to do it a second time in the PHP script. Thank you.
Re: SELECT with Result Ordered by Minimum of Fields
David T. Ashley wrote: On 8/6/06, Chris W [EMAIL PROTECTED] wrote: David T. Ashley wrote: Can I just write something like: SELECT * FROM mytable WHERE fieldofinterestvalue ORDER BY MIN(field1, field2) ASC; I think this will work.. SELECT *, IF(a-b 0,a, b) as SortField FROM table WHERE whatever ORDER BY SortField Question: Is there any way to get SortField (or a similar per-selected-record field) included with the SELECT output? The reason for this inquiry is that my PHP script that uses the SELECT results will also have to calculate SortField as MySQL did as part of the query. If MySQL has done it already, no need to do it a second time in the PHP script. If you run that select in MySQL query browser you will see that in addition to all the other fields in the table it adds to the end a field called SortField. If you would like it at the beginning they change it to . SELECT IF(a-b 0,a, b) as SortField, * If you want it the middle you will need to list every field in the select with the SortField if between the 2 you want it between -- Chris W KE5GIX 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]
Replicating -- sort of 2 way
Before I go reading too deep into the documentation I would like to know if this is even possible or if it is just a bad idea. I have Server A with DB X, and server B with DB Y. I would like to set up Server A and B as both a replication master and slave. Where Server A would be the Master for DB X and the Slave for DB Y AND Server B would be the Master for DB Y and Slave for DB X. The reason I am doing this is just for keeping a backup. Is this a bad idea? Any better ways? -- Chris W KE5GIX 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]
text mode listing
Hi Can you remind me how to tell mysql to list vertically instead of horiz in text mode? Ex: select all * from a_tablesends field1 field2 . I want field1 field2 field... Thanks -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Can't get v5.0.22 to work;alternatives?
Hi, Earlier, I forgot to CCed the reply to the list and, accidentally, posted a blank reply instead. So, here is the copy of the reply that I sent to the original poster - in case, someone else has the same problem. Additionally, I have found that the MySQL ODBC driver installs best when you do it manually - that is, hand-copy files into the Windows System32 directory. In addition, as I have found, it complains that some MSVCR7.dll is missing. When I searched for the file on Google, the search engine led me to some DllFiles.com (or some similar webpage) where I got the file, downloaded the same to my computer and everything worked like a cinch! -- Good luck, Asif On 8/1/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I can't get MySQL v5.0 to work on my system. I got MySQL 5.0.22 running successfully on Win-XP-SP2 as follows: 1) Download the no-install zip package of MySQL-5.0.22 from the website. 2) Unpack it in the directory of your choice (C:\mysql5 - for example) 3) Create a top-level folder - C:\mysql5Data for the data directory. 4) Cut the contents of C:\mysql5\data directory and paste the same into C:\mysql5Data. 5) Delete C:\mysql5\data directory. 6) Create a copy of an appropriate mysql-xxx.ini file and rename it to MY.INI. 7) Change the value of the data-dir variable to C:/mysql5Data - NOTE FORWARD INSTEAD OF BACK-SLASHES. 8) Create another top-level C:\InnoDBData folder. 9) Change appropriate InnoDB data-directory variables in C:\my.ini (with forward slashes!) 10) Right-click MY COMPUTER icon on the desktop and select properties from the shortcut menu. Goto the Advanced tab and select Environment [Variables]. Select PATH in the \ system variables and add C:\mysql5\bin; at the beginning of it. Apply and OK. 11) Select RUN from the start menu, type CMD and press ENTER. 12) Right click the C:\InnoDBData folder, select Properties from the shortcut menu and add LOCAL SERVICE user-account in the security tab and give it Full Control access. 13) Do the same as in 12) with the C:/mysql5Data folder. 12) type mysqld-nt --install YourServiceName --defaults-file=C:\mysql5\my.ini --local-service and press ENTER. 13) type NET START YourServiceName AND PRESS ENTER. Now you have MYSQL-5.0.22 installed on WinXP-Pro-SP2. Forget about the automatic installer. I got similar errors like yours. -- HTH, Asif -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Possible to use multiple conditions in SET/Declare?
Hi All, I know that we can do stuffs like declare @temp1 varchar(20), @temp2 varchar(20) set @temp1 = A set @temp2 = Z select * from table where table.column = @temp1 I would like to do something like this. set @temp1 = ('A','B','C') select * from table where table.column IN @temp1 Is it possible? -- Ow Mun Heng [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Error 1032 : Can't find Record in table
Detlev, It is possible that mysql is interpreting adr-0 as a arithmetic operation, why don't you try quoting the table name to prevent mysql trying to interpret it as anything... insert into `adr-0` values ('TestAdr','1') on duplicate key update qty = qty +1; regards, Enrique. --- Detlev Jaeger [EMAIL PROTECTED] wrote: Hello, I'm curently testing partitioning with mysql 5.1.11 on linux (.rpm from mysql.com site). Table Structure: CREATE TABLE `adr-0` ( Adr varchar(255) COLLATE latin1_german1_ci NOT NULL DEFAULT '', Qty int(10) NOT NULL, PRIMARY KEY (Adr), ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci PARTITION BY KEY (Adr) PARTITIONS 10 ; Now I'm inserting data: insert into adr-0 values ('TestAdr','1') on duplicate key update qty = qty +1; This works fine until on duplicate key triggers. Then I receive the error message: 1032: Can't find record in adr-0 When I'm doing the same on a non-partitioned table, everything work as expected. I haven't found any limitations of the partitioning in the manual, which could be the reason. Is this a bug or a feature ? Thanks in advance for any help ! Detlev -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] Enrique Sanchez Vela email: [EMAIL PROTECTED] -- http://www.savetheinternet.com/ __ 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: Replicating -- sort of 2 way
Chris, Replicating for the sake of backups is in general a bad idea, since once you delete/update a record, it will be automatically propagated to the slave server. Replication, should be used to provide better availabilty/load balancing but that would need to be setup as part of a bigger plan to provide higher availabilty to the service that you are providing. One thing that you could do, is to setup a replicating slave server, freeze the replication, perform backups (to tape/disks etc), then re-enable the replication activity, this way you provide a non-stop service without compromising your data availabilty. best regards, Enrique. --- Chris W [EMAIL PROTECTED] wrote: Before I go reading too deep into the documentation I would like to know if this is even possible or if it is just a bad idea. I have Server A with DB X, and server B with DB Y. I would like to set up Server A and B as both a replication master and slave. Where Server A would be the Master for DB X and the Slave for DB Y AND Server B would be the Master for DB Y and Slave for DB X. The reason I am doing this is just for keeping a backup. Is this a bad idea? Any better ways? -- Chris W KE5GIX 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] Enrique Sanchez Vela email: [EMAIL PROTECTED] -- http://www.savetheinternet.com/ __ 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]
replication maybe?
hey i have a question ; if i have a MySQL database on our local intranet server, but i wanna be able to replicate that database to our internet site thats also a MySQL database so whenver something changes on our intranet it also changes on our Internet Database,,how do i do this ??? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: replication maybe?
Hi Brian, Try having a good read here : http://dev.mysql.com/doc/refman/5.0/en/replication.html Regards --- ** _/ ** David Logan *** _/ *** ITO Delivery Specialist - Database *_/* Hewlett-Packard Australia Ltd _/_/_/ _/_/_/ E-Mail: [EMAIL PROTECTED] _/ _/ _/ _/ Desk: +618 8408 4273 _/ _/ _/_/_/ Mobile: 0417 268 665 *_/ ** ** _/ Postal: 148 Frome Street, _/ ** Adelaide SA 5001 Australia invent --- -Original Message- From: Brian E Boothe [mailto:[EMAIL PROTECTED] Sent: Monday, 7 August 2006 8:47 AM To: mysql@lists.mysql.com Subject: replication maybe? hey i have a question ; if i have a MySQL database on our local intranet server, but i wanna be able to replicate that database to our internet site thats also a MySQL database so whenver something changes on our intranet it also changes on our Internet Database,,how do i do this ??? -- 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: Replicating -- sort of 2 way
Enrique Sanchez Vela wrote: Chris, Replicating for the sake of backups is in general a bad idea, since once you delete/update a record, it will be automatically propagated to the slave server. Replication, should be used to provide better availabilty/load balancing but that would need to be setup as part of a bigger plan to provide higher availabilty to the service that you are providing. One thing that you could do, is to setup a replicating slave server, freeze the replication, perform backups (to tape/disks etc), then re-enable the replication activity, this way you provide a non-stop service without compromising your data availabilty. The reason I am wanting to use it as a backup is because it is easy automatic and I don't have to do anything once it is set up. The backup would be in case of disk failure not data corruption. I would probably run local backups too. The replication I was planing on doing was going to be between 2 servers at 2 different locations, which would allow for the best backup in case of disaster that completely destroyed one location. -- Chris W KE5GIX 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]
Re: Replicating -- sort of 2 way
--On August 6, 2006 2:01:15 PM -0700 Enrique Sanchez Vela [EMAIL PROTECTED] wrote: One thing that you could do, is to setup a replicating slave server, freeze the replication, perform backups (to tape/disks etc), then re-enable the replication activity, this way you provide a non-stop service without compromising your data availabilty. I've tried this in the past. Replication on large, non-single-application database servers is hard. When you have over a thousand users on a single (very large) DB server the chances that one of them will trip one of the 'does not replicate correctly to slave and causes slave to stop dead in tracks' bugs is pretty high. We found (even with 4.1 series) that we were restarting or dealing with stopped replication on a daily basis. We stopped trying somewhere around 4.1.11 so things may have improved, but they may not have. For a single application or a limited set of applications it seems to work great and you can whittle out any cases where the app does something that doesn't replicate correctly somehow. With large numbers of apps/people using it we usually had to turn down or turn off the error checking on the slave so it wouldn't stop in it's tracks all the time. This of course caused the issue of you were never totally sure that what was on the slave was what was on the master. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: where may I find sqlplus.hh??
On Thursday, 3 August 2006 at 22:56:54 -0700, Ratnadeep Nayak wrote: Hello, I have downloaded a code on c++ to talk to MySQL database from net which included a file sqlplus.hh , where may I find the file?Please help me soon. It's not in our code. It must be in the code you downloaded. If you don't find it there, follow up with the author. Greg -- Greg Lehey, Senior Software Engineer, Online Backup MySQL AB, http://www.mysql.com/ Echunga, South Australia Phone: +61-8-8388-8286 Mobile: +61-418-838-708 VoIP: sip:[EMAIL PROTECTED], sip:[EMAIL PROTECTED] Diary http://www.lemis.com/grog/diary.html Are you MySQL certified? http://www.mysql.com/certification/ pgp7AbqDspfBb.pgp Description: PGP signature