jdbc question regarding enum

2006-11-01 Thread Jon Drukman
disclaimer: i know nothing about java or jdbc. a co-worker is trying to access a database i've set up using jdbc. he says that my enum column is always returning an integer value instead of the string. obviously this is less than desirable. does anybody have any advice i could give him on

Re: MySQL Load Balancing

2006-08-08 Thread Jon Drukman
Ed Pauley II wrote: This is another geographical location with automatic failover if there is a problem, network, hardware etc. with the primary location. When the problem is corrected, or corrects itself the traffic is automatically sent back to the primary location. Without 2-way replication

Re: Index and multiple fields

2006-04-03 Thread Jon Drukman
Markus Fischer wrote: Basically, this means if I've a table like this id1 id2 id3 id4 id5 and I've two different select statements: select * from ... where id1 = .. and id2 = .. and the other being select * from ... where id3 = .. and id4 = .. I would create two indexes, one for id1/id2

Replication: slaves don't change to new log file properly

2006-03-16 Thread Jon Drukman
Our mysql master machine crashed (hardware problem) and rebooted. When it came back up, it started a new master log file. The slaves, however, were all stuck on the last log file. They still showed both replication threads running, no errors, but they just did not advance. I had to

MySQL Control Center

2005-11-22 Thread Jon Drukman
What happened to MySQL Control Center (aka mycc or mysqlcc)? The dev.mysql.com site redirects to the Query Browser page. QB is a poor substitute for mycc. It looks like neither of them has had active development much lately but at least mycc, even in its beta stage, is fairly useful.

Re: Replication fails with file not found error - but file is there

2005-11-01 Thread Jon Drukman
Gleb Paharenko wrote: Hello. Have a look here: http://dev.mysql.com/doc/refman/5.0/en/not-enough-file-handles.html thanks, i've upped the open-files-limit variable. we'll see how it goes. -jsd- -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

Replication fails with file not found error - but file is there

2005-10-31 Thread Jon Drukman
Master and slaves are both Mysql 4.1.14 standard. There are six slaves, and this error kept happening on #2 and #4, but then it stopped. I thought it was all gone for good but today it happened on #3. The symptom is: Replication stops with the following error: Error 'Can't find file:

Recommendations for memory use with 16GB

2005-09-27 Thread Jon Drukman
I'm moving from 32-bit intel to the brave new world of AMD64. Our new servers are dual Opterons with 16GB of RAM. We will be running mysql 4.1.14-standard on redhat enterprise linux 4 x86_64. Since I'm new to this, what's my best bang-for-buck in setting up mysql's memory usage? -jsd-

Re: Finding the most recent related record?

2005-08-17 Thread Jon Drukman
Brian Dunning wrote: I have a table of questions, and a table of answers. Each question has a related answer record for each person who has answered that question, and each answer is timestamped. How do I find a list of questions where the MOST RECENT answer is less than 30 days ago?

Re: convert varchar to char

2005-08-16 Thread Jon Drukman
Pooly wrote: Damnit ! Thanks for pointing it, I forgot these things. But it's a bit more subtle : If any column in a table has a variable length, the entire row becomes variable-length as a result. Therefore, if a table contains any variable-length columns (VARCHAR, TEXT, or BLOB), all CHAR

slow count(1) behavior with large tables

2005-07-15 Thread Jon Drukman
i'm trying to run this query: SELECT COUNT(1) FROM MSGS m, MBOARD b WHERE b.BaseType = 0 AND m.BoardID = b.BoardID; MSGS has 9.5 million rows, and is indexed on BoardID MBOARD has 69K rows and is indexed on BaseType EXPLAIN shows: mysql explain SELECT COUNT(1) FROM MSGS m, MBOARD b WHERE

Re: slow count(1) behavior with large tables

2005-07-15 Thread Jon Drukman
Andrew Braithwaite wrote: Hi, You're doing a join on 'BoardID' on the tables MSGS and MBOARD. Is the BoardID field indexed on the MSGS table too? If not then that may be your problem. MSGS.BoardID is indexed, and the EXPLAIN output I included in the original message shows that it is

Re: slow count(1) behavior with large tables

2005-07-15 Thread Jon Drukman
Andrew Braithwaite wrote: Sorry, I meant to say is the 'BoardID' field indexed on the MBOARD table too? yes, BoardID is the primary key. BaseType is also indexed. from the EXPLAIN output i can see that mysql is choosing to use BaseType as the index for MBOARD (as we know, mysql can only use

Re: simple concurrency problem - any advice ??

2005-01-14 Thread Jon Drukman
Tim Wood wrote: a-- select test_id from tests where status=1 and priority 11 order by priority b-- update tests set status=2 where test_id = result of query above What's the best way to ensure that a single client executes both a and b atomically so that no other client can show up and execute

Re: Problems with replication restarting

2004-12-20 Thread Jon Drukman
[EMAIL PROTECTED] wrote: So this would imply that you cannot simply stop/start a slave server - instead, I would need to write a wrapper script that stops the slave using STOP SLAVE, and at next startup, read the master.info file to find out where it left off, and then issue a CHANGE MASTER TO...

Re: appropriate column type to store day and time in YYYYMMDDhhmmss format

2004-12-17 Thread Jon Drukman
Jason Joines wrote: I'm using MySQL 4.1.7 and need to create a column to store date and time. Also, I need to be able to update the column with something like: update machines set update3_status='y', update3_time=SOMETHING; I don't want update3_time to be automatically changed any time

Re: MySQL load balancing...

2004-12-16 Thread Jon Drukman
Kevin A. Burton wrote: Was curious what people on the list are using for load balancing.. there are a number of techniques here but it would be interesting if people could share some real-world experiences HTTP load balancing is pretty well understood but there's not a bunch out there on

Re: A Select improvement

2004-12-01 Thread Jon Drukman
Dan Sashko wrote: Hi, anyone has suggestions what changes to make to allow this query to run faster? SELECT domain FROM tbl_1 WHERE id 0 and id 2 domain = 12.221.190.111 AND score IS NOT Null AND data LIKE %param=search GROUP BY domain, data -- every one of those WHERE clauses

Re: converting to Innodb.

2004-12-01 Thread Jon Drukman
Fredrik Carlsson wrote: Hi list, I have a question regarding mysql and innodb. My current setup uses myisam and the db size is about 1.6 GB with two table that each have about 500k rows. I perform alot of fulltext search on these tables and they can sometimes take along time to finish and when

Replication problems - packet sizes and more

2004-11-24 Thread Jon Drukman
My master has two databases: channel and hardware. I'm only interested in replicating hardware, so I set up replicate-do-db=hardware on the slaves. However, I am having problems because of giant LOAD DATA operations performed nightly on channel. Replication blows up with max packet exceeded

Re: Replication problems - packet sizes and more

2004-11-24 Thread Jon Drukman
i probably should have mentioned: both master slave are running 4.0.20 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Replication + InnoDB = badness

2004-08-03 Thread Jon Drukman
We were having terrible problems with a master/slave setup. The master does a huge amount of writes, and the slave simply started lagging behind, despite both machines being identical hardware-wise. This made the application basically unusable because eventually the slave was hours behind

RE: Replication + InnoDB = badness

2004-08-03 Thread Jon Drukman
Also even after we re-converted all the slave's Inno tables back to MyISAM it *still* lagged out. Only after I disabled the Inno engine entirely did the problem abate. Any ideas why? Does InnoDB use resources even if there are no active tables using the engine? This is most

RE: Replication + InnoDB = badness

2004-08-03 Thread Jon Drukman
From: David Griffiths [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 03, 2004 1:04 PM Subject: Re: Replication + InnoDB = badness Could it be a network bandwidth issue? Remember, all that data needs to be transmitted across to the slave. If you are on a 10-megabit network, it could

replication slave lags way behind master

2004-08-02 Thread Jon Drukman
i've got one master and one slave. the master is VERY busy, tons of inserts/updates/deletes all the time. (it's an extremely high traffic message board system.) we've got a situation right now where the slave starts lagging WAY behind the master. it's as if it simply can't run through the

Re: Fw: Tuning MySQL for Large Database

2004-07-29 Thread Jon Drukman
matt ryan wrote: There is a perl script that comes with MySQL called mysqldumpslow. You can just run it on your slow log and it will output summary statistics about the slow log. I saw that in the docs, but I definitly dont want to install perl on a production server, I never looked to see

SELECT DISTINCT + ORDER BY confusion

2004-07-09 Thread Jon Drukman
I've got a product story setup where there can be multiple stories of a given type for any product. I want to find the names of the products with the most-recently-posted stories of a certain type. This query works well: SELECT p.id,p.title FROM product p join e_prod ep on ep.product=p.id

Re: SELECT DISTINCT + ORDER BY confusion

2004-07-09 Thread Jon Drukman
Victor Pendleton wrote: Have you tried using a group by clause? Group by title same problem - the group by happens before the order by and you get essentially random results. -Original Message- From: news To: [EMAIL PROTECTED] Sent: 7/9/04 3:08 PM Subject: SELECT DISTINCT + ORDER BY

Re: php to mysql

2004-06-03 Thread Jon Drukman
venkata ramana wrote: Hi, I don't know whether I can ask this question on this mailing list or not, but I want to know how the php communicates with mysql, when it is on the localhost. Does it use unix domain sockets or it uses TCP sockets only? Any help or pointers in this regard will be

avoiding Using filesort

2004-06-02 Thread Jon Drukman
i've read the ORDER BY optimization page in the manual but i'm stumped by my inability to get this query to avoid the filesort. the table structure is: CREATE TABLE story ( id int(11) NOT NULL auto_increment, headline text, deck text, free_override tinyint(1) NOT NULL default '0',

Re: avoiding Using filesort

2004-06-02 Thread Jon Drukman
Victor Pendleton wrote: What does the explain plan look like? It sounds like the query is using the fulltext index. Remember that only one index per table can be used when performing a query. explain select id, headline, date_format(s.post_date,'%Y/%m/%d') directory, post_date sort_date from

Re: Cluster and Fulltext indexes?

2004-06-01 Thread Jon Drukman
Santino wrote: Hello, Does the cluster support fulltext indexes? After a quick reading of preliminary documentation it seems NO. Can someone confirm it? i had a meeting with the mysql cluster sales team and they said it is not supported. fulltext is for myisam only. cluster uses NDB storage

Re: DB hanging

2004-05-25 Thread Jon Drukman
Brandon Metcalf wrote: We are running 3.23.58 on Solaris 8 and seeing the following problem. Periodically, mysqld gets into a state where we can't query just one table in all of our DBs--queries just hang. Restarting mysqld always fixes the problem, but a SIGKILL is required to stop it. Could

Re: Doing MySQl DB File backups

2004-05-18 Thread Jon Drukman
Ben Ricker wrote: I believe all the tables are MyISAM...the DB is 3.2.x. I know there will be an inconsistency as we only do nightly backups; any transactions that occur before the scp will not be there. If we failover before the backup, we can have up to 24 hours of data missing. I am concerned

Re: avoiding Locked threads

2004-05-14 Thread Jon Drukman
Dathan Vance Pattishall wrote: log-bin=/var/opt/mysql/db2-binlog skip-innodb log-error=/var/opt/mysql/db2-errlog This is on a separate drive? yes, the database is the only thing on the high speed RAID. everything else is on the other drive (also a RAID but only RAID0 with 2 drives). any ideas

avoiding Locked threads

2004-05-13 Thread Jon Drukman
I've got a very high traffic discussion forum database that is constantly running into a problem with lots and lots of threads in the Locked state. i was under the impression that MySQL could update/insert and select from the same table at the same time, but it doesn't seem to be the case.

my.cnf and binary distributions

2003-09-19 Thread Jon Drukman
is there any way to get mysqld 4.0.15a from the linux binary distribution to use another path for my.cnf apart from /etc/my.cnf /usr/local/mysql/data/my.cnf ~/.my.cnf the problem is at my company i am not allowed to install things as root, so i can't put files in /etc or /usr/local/mysql/data.

Re: my.cnf and binary distributions

2003-09-19 Thread Jon Drukman
At 11:13 AM 9/19/2003, Paul DuBois wrote: At 10:42 AM -0700 9/19/03, Jon Drukman wrote: is there any way to get mysqld 4.0.15a from the linux binary distribution to use another path for my.cnf apart from /etc/my.cnf /usr/local/mysql/data/my.cnf ~/.my.cnf No, but if you have control over how

MyODBC 3.51 + Windows Server 2000 = Memory Leak

2003-08-23 Thread Jon Drukman
We have a very high traffic mysql app running in ASP on Windows 2000. It connects to a Linux mysql server (4.0.12) via ADODB and MyODBC. It's leaking memory like crazy. We've implemented connection pooling and long timeouts on connections so as to minimize the number of connects closes, but

Re: PHP mysql_connect randomly failing

2003-08-22 Thread Jon Drukman
Antony Dovgal wrote: try to use error_reporting(E_ALL); and to see what happends. maybe error logging will help you to solve your trouble. I don't beleive in such bugs, it's a problem of your code imho. here's my code: mysql_connect() or die(mysql connect failed: $php_errmsg / . mysql_error());

Re: apache/mysql errors....

2003-08-21 Thread Jon Drukman
bruce wrote: Hi... A mysql/Apache issue: I get the following when I'm trying to run a test web site on an Apache 2.0/RH8.0 setup. Warning: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) in /var/www/html/dbid/mysql/database.php on line 17

Re: PHP mysql_connect randomly failing

2003-08-21 Thread Jon Drukman
Antony Dovgal wrote: On Tue, 19 Aug 2003 14:36:15 -0700 Jon Drukman [EMAIL PROTECTED] wrote: Approximately 1% of the time it just fails, for no stated reason: Warning: mysql_connect() [http://www.php.net/function.mysql-connect]: in /var/httpd/htdocs/pi/pi.php on line 3 mysql connect failed

Re: Delete questions and speed/safety issues

2003-08-21 Thread Jon Drukman
Jack Coxen wrote: I had originally planned to use syntax similar to: DELETE * FROM table_name WHERE `dtime` [90 days ago] delete * from table_name where to_days(now())-to_days(dtime) 90 After the DELETE runs, I plan on running MYISAMCHK on the affected table. Then I'll repeat both steps for

Re: Optimizing a query

2003-08-21 Thread Jon Drukman
gord barq wrote: I have this query which does a left outer join and it takes forever (like half a day). Here are the results of an explain analysis. mysql explain SELECT count(searchresult.title) AS number, campaigntrack.title, tracknum, trackid FROM campaigntrack LEFT OUTER JOIN searchresult

Re: RAID or not?

2003-08-21 Thread Jon Drukman
Jackson Miller wrote: I am setting up a dedicated MySQL server with some pretty heavy usage. I am not much of a sys admin (mostly a programmer). I have some questions about the best drive configuration. I have 4 SCSI drives currently. I would like to have 1 drive run the OS, 1 drive to be

Re: PHP mysql_connect randomly failing

2003-08-21 Thread Jon Drukman
Antony Dovgal wrote: mysql_error is not set when mysql_connect fails, because there is no actual mysql resource to get the error message from. yes, there is no mysql resource at this moment. just don't specify it and mysql_error() will tell something like Can't connect to local MySQL server

Re: RAID or not?

2003-08-21 Thread Jon Drukman
Lefevre, Steven wrote: I say go with RAID 5, on a controller card. Mirroring just gives you backup, and you lose half your diskspace. It offers no performance benefit, and actually the computer might have to work harder to make sure the drives are in sync. that is not true. mirroring gives you

PHP mysql_connect randomly failing

2003-08-19 Thread Jon Drukman
I've got a library of PHP code whose first line is a mysql_connect statement, like this: $dbh=mysql_connect() or die(mysql connect failed: $php_errmsg); Approximately 1% of the time it just fails, for no stated reason: Warning: mysql_connect() [http://www.php.net/function.mysql-connect]: in

Re: PHP mysql_connect randomly failing

2003-08-19 Thread Jon Drukman
unix domain. Michael S. Fischer wrote: Are you connecting through a TCP or a UNIX domain socket? --Michael -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jon Drukman Sent: Tuesday, August 19, 2003 2:36 PM To: [EMAIL PROTECTED] Subject: PHP mysql_connect randomly

GROUP BY is too greedy

2003-02-18 Thread Jon Drukman
this query: select ep.product, s.id,s.type,s.headline,date_format(post_date,'%a, %m/%d/%y - %h:%m %p') date,user_level,s.ext_url from story s left join e_prod ep on ep.story=s.id where s.post_date date_sub(now(), interval 14 day) and s.status = 9 order by post_date desc limit 10 returns the

Re: Replication slave repeatedly gets error 1159 from master

2002-07-15 Thread Jon Drukman
At 04:26 AM 7/15/2002, David Harper wrote: Description: Every 60 seconds, the replication slave gets an error 1159 from the master server. Thirty seconds later, it reconnects to the master. Then the cycle starts all over again. I have master-connect-retry=30 in the config file. Here is

Re: how to retrieve the 2 last char of a string stored in db

2002-07-15 Thread Jon Drukman
At 01:01 PM 7/15/2002, David yahoo wrote: how to retrieve the 2 last char of a string stored in db ? : SELECT LENGTH(db) as len , SUBSTRING(db from len-2 ) from nlconfig; NOT WORK .! In php by example, there is a substr with a negative pos that give char at end ! no in mysql ! select

Re: redirection limit display accross multi pages .... ????

2002-07-13 Thread Jon Drukman
At 05:25 AM 7/13/2002 +, toby - wrote: 1. i ve a page that picks up random records from mysql database and displays them now i want to limit the display to 5 or 6 records per page that is if it could pickup ALL the records in the db and disolay only 5 or 6 on each page select blah from blah

replication error 1159

2002-07-12 Thread Jon Drukman
i am having the Error reading packet from server: (server_errno=1159) replication problem. in searching the archives for others experience replication problems, i came across the suggestion of adding these lines to my.cnf set-variable = slave_net_timeout=3600 set-variable =

Re: replication error 1159

2002-07-12 Thread Jon Drukman
At 01:48 PM 7/12/2002, Jeremy Zawodny wrote: On Fri, Jul 12, 2002 at 01:43:02PM -0700, Jon Drukman wrote: now instead of getting the error every 30 seconds, i get it every hour. is there a way to make it go away forever? Make the number really big? I wonder if you can set it to 0 to mean

Re: outer join + count() + group by

2002-02-12 Thread Jon Drukman
At 01:43 AM 2/12/2002, you wrote: Hi, Does this work for you? select ad.id,adtype,name,sum(review.id is not null) from person review left join ad on ad.id=review.id group by ad.id; this one returns 1 for the sum column no mater what. select ad.id,adtype,name,sum(if

outer join + count() + group by

2002-02-11 Thread Jon Drukman
i have what is basically a personal ad database. in one table, i have a list of advertisers. in another table i have a list of reviews. (there's a third table with stuff like their name, address, etc). i want to get a list of advertisers and the number of reviews all in one query. i can

stupid join question

2001-12-14 Thread Jon Drukman
i'm trying to join 3 tables. tables 1 and 2 contain information about a person, table 3 contains reviews of that person and may not have any data. outer join, right? i can't get it to work though. the tricky part is i don't want to return the actual data from the 3rd table, i just want the

Re: BUG: unlock tables causes hang

2001-09-25 Thread Jon Drukman
At 10:40 AM 9/25/2001 -0700, Jon Drukman wrote: Description: mysql apparently gets stuck when unlocking tables i have several applications that do: LOCK TABLES pv WRITE LOAD DATA LOCAL INFILE 'pageview.data' INTO TABLE pv (id,count,date) UNLOCK

Re: Command?

2001-09-18 Thread Jon Drukman
At 03:30 PM 9/18/2001 -0500, Jay Paulson wrote: What is the command in MySQL to grab the last item that was inserted into the database? i'm 99% sure there isn't one. a sql table is an unordered set. there is no concept of first or last. in theory you could get the same SELECT statement

mysql 3.23.42 hangs on solaris 7

2001-09-14 Thread Jon Drukman
i have been running 3.22.25 on solaris 7 for quite a while. i ran into a problem with it a few days ago where it basically took forever to delete rows (these are huge tables - several million rows, with lots of indexes, and i needed to delete some millions of rows... i started it, and let it