RE: comparing two databases

2006-09-29 Thread Andrew Braithwaite
Some freebies: PHP: http://sourceforge.net/projects/phpmycomparer Perl: http://freshmeat.net/projects/mysqldiff/ Cheers, Andrew -Original Message- From: Steve Buehler [mailto:[EMAIL PROTECTED] Sent: Thu, 28 Sep 2006 21:06 To: mysql Subject: comparing two databases Is there a program

Group by and concatenate

2006-10-11 Thread Andrew Braithwaite
Hi, I have the following data: mysql> select Dealername,pc from ford_gb where pc='LE4 7SL'; +-+-+ | Dealername | pc | +-+-+ | CD Bramall Ford - Leicester | LE4 7SL | | CD Bramall Ford - Leicester | LE4

RE: Group by and concatenate

2006-10-11 Thread Andrew Braithwaite
l - Leicester | LE4 7SL | LE4 7SL | | CD Bramall Trucks | LE4 7SL | LE4 7SL,LE4 7SL | ++-+--+ Andrew -Original Message- From: Andrew Braithwaite [mailto:[EMAIL PROTECTED] Sent: Wed, 11 Oct 2006 14:32 To: mysql@lists.mysql.com S

Re: slow count(1) behavior with large tables

2005-07-15 Thread Andrew Braithwaite
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. Cheers, Andrew On 15/7/05 23:31, "Jon Drukman" <[EMAIL PROTECTED]> wrote: > i'm trying to run this query: > > SELECT COUNT(1) FROM M

Re: Group By query optimization

2005-07-15 Thread Andrew Braithwaite
Hi, Put indexes on 'valid' and 'sessiontype' and all will be good. Cheers, Andrew On 15/7/05 18:26, "Kishore Jalleda" <[EMAIL PROTECTED]> wrote: > Hi All, > I have a mysql query which takes 8 seconds to run ona dual > xeon 2.4, 3Gig ram box, > SELECT gamename, MAX(score) AS score, C

Re: slow count(1) behavior with large tables

2005-07-15 Thread Andrew Braithwaite
Sorry, I meant to say is the 'BoardID' field indexed on the MBOARD table too? Cheers, A On 16/7/05 00:01, "Andrew Braithwaite" <[EMAIL PROTECTED]> wrote: > Hi, > > You're doing a join on 'BoardID' on the tables MSGS and MBOARD. Is the >

possible MySQL bug - insert into 'double' column problem with mysql 4.1

2005-09-19 Thread Andrew Braithwaite
Hi All, I have a strange error when trying to insert into a table with 2 'double' fields. It inserts into the 1st field OK but fills the 2nd one with nines. See below for a complete recreate. Is this a known problem? Does anyone have a solution? I'm running standard MySQL binaries on redhat l

RE: possible MySQL bug - insert into 'double' column problem with mysql 4.1

2005-09-19 Thread Andrew Braithwaite
Thanks; you're absolutely right - doh! It's just amazing that this ever worked in MySQL 4.0 and below... Andrew -Original Message- From: Roger Baklund [mailto:[EMAIL PROTECTED] Sent: Mon, 19 Sep 2005 12:27 To: mysql@lists.mysql.com Cc: Andrew Braithwaite Subject: Re: possible

Re: possible MySQL bug - insert into 'double' column problem with mysql 4.1

2005-09-19 Thread Andrew Braithwaite
999 | 9.99 | 50.123456 | +---+---+---+ 2 rows in set (0.06 sec) Looks like while MySQL 4.1 was not changing what was stored in the data but changing what is inserted into new records to match the proper data tye definitions. On 19/9/05 17:49, "Andrew Braithwaite" <[EM

4.1 replication logs growing at a much greater rate than with 4.0

2005-10-03 Thread Andrew Braithwaite
Hi all, I have just upgraded a master slave database system from 4.0 to 4.1. the replication binlogs are now growing at a vastly greater rate. The queries going through are the same. Did 4.0 use some kind of compression by default or something? Does anyone have any idea what's going on wi

RE: How to match a binary null in a varchar column???

2005-10-03 Thread Andrew Braithwaite
Hi, You could try the binary operator: http://dev.mysql.com/doc/mysql/en/charset-binary-op.html Cheers, Andrew -Original Message- From: Richard F. Rebel [mailto:[EMAIL PROTECTED] Sent: Mon, 03 Oct 2005 17:48 To: Untitled Subject: How to match a binary null in a varchar column??? Hel

Resend: 4.1 replication logs growing at a much greater rate than with 4.0

2005-10-04 Thread Andrew Braithwaite
Hi all, I have just upgraded a master slave database system from 4.0 to 4.1. the replication binlogs are now growing at a vastly greater rate. The queries going through are the same. Did 4.0 use some kind of compression by default or something? Does anyone have any idea what's going on with thi

RE: Resend: 4.1 replication logs growing at a much greater rate than with 4.0

2005-10-04 Thread Andrew Braithwaite
g that the group has experienced by the looks of it. Thanks for the help anyway. Cheers, Andrew From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tue, 04 Oct 2005 14:32 To: Andrew Braithwaite Cc: mysql@lists.mysql.com Subject: Re: Resend: 4.1

Subquery strangeness when used in FROM clause

2005-12-06 Thread Andrew Braithwaite
Hi, I'm having a problem with subqueries in MySQL 4.1.14 running on Fedore core 3. mysql> create table day_6_12_2005 (f1 int(1), f2 char(4)); Query OK, 0 rows affected (0.04 sec) mysql> insert into day_6_12_2005 values(1,'test'); Query OK, 1 row affected (0.00 sec) mysql> select * from (select

Last access time of a table

2006-02-03 Thread Andrew Braithwaite
Hi everyone, Does anyone know if there is a way to get the last access time from a mysql table through mysql commands/queries? I don't want to go to the filesystem to get this info. I understand that this could be tricky especially as we have query caching turned on and serve quite a few sql req

RE: Annoying .mysql_history problem

2009-04-03 Thread Andrew Braithwaite
I know it's not quite the same but you can use a 'tee' to record what you do. I use a small script to invoke the mysql client that looks like this: and...@myserver:~/bin> cat ms # takes input of server and logical DB, eg: 'ms db1 test' echo "" >> /home/andrew/mysqlhistory/$1.history echo "==

RE: MySQL replication status plugin

2009-04-15 Thread Andrew Braithwaite
You could try this: http://www.consol.de/opensource/nagios/check-mysql-health (in German but should be self-explanatory). Cheers, Andrew -Original Message- From: Gabriel - IP Guys [mailto:gabr...@impactteachers.com] Sent: 15 April 2009 10:12 To: replicat...@lists.mysql.com Cc: mysql@l

RE: Is Temporary table right approach

2009-04-17 Thread Andrew Braithwaite
>> If you can not eliminate your temporary tables, you have to adjust the following parameters in my.cnf [mysqld] >>max_heap_table_size=1G >>tmp_table_size=1G You're making a lot of assumptions about this guy's setup. You shouldn't just tell him to apply these kinds of settings as you don't what

RE: Index time columns?

2009-04-27 Thread Andrew Braithwaite
Hi, If you have that date column in your where clause for example: SELECT .. FROM . WHERE tstamp > NOW() - INTERVAL 1 WEEK; Then it's essential to index that column to speed up a table with lots of data. On a table with many rows, an index on a timestamp column is invaluable. However,

RE: Slowness connecting to MySQL

2009-05-04 Thread Andrew Braithwaite
It could be slow reverse DNS lookups. Make sure the hostname/IP of the client are in the server's host file. Or try connecting to the server using an IP address instead of hostname. Andrew -Original Message- From: Menachem Bazian [mailto:gro...@bcconsultingservices.com] Sent: 04 May 20

RE: Creation date

2009-05-05 Thread Andrew Braithwaite
The create date in show table status is metadata held in the table itself wheras the create data on the .frm file is when that file was created - i.e. if you copy the data files (without preserving attributes) it will have a new creation date on the filesystem but the metadata of the table will not

RE: Default my.cnf for (very) high performance servers....

2009-05-06 Thread Andrew Braithwaite
There's no such thing as a generic my.cnf for high performance MySQL servers, you will need to provide more information.. Some questions: Are you going to run InnoDB or MyISAM or both (if both, what's the split?) Is there anything else running on that server? i.e. how much of the 16GB is availa

RE: Default my.cnf for (very) high performance servers....

2009-05-06 Thread Andrew Braithwaite
li...@codenation.net] Sent: 06 May 2009 14:31 To: Andrew Braithwaite Cc: mysql@lists.mysql.com Subject: Re: Default my.cnf for (very) high performance servers Andrew Braithwaite wrote: > There's no such thing as a generic my.cnf for high performance MySQL > servers, you will need

RE: Merging Databases

2009-05-11 Thread Andrew Braithwaite
If you are merging table A and table B and say, table A's auto-increment id is up to 2000, just pick a nice round number like 3000 and add it to the auto-increment ID column of table B with something like this: UPDATE tableB SET id = id + 3000; Then do the same to all the fields in other tables t

RE: Inserting a default null date

2009-05-15 Thread Andrew Braithwaite
Agreed. And don't forget to listen to the warnings MySQL sends back, e.g.: mysql> create table temp_date(d date default null); Query OK, 0 rows affected (0.15 sec) mysql> insert into temp_date(d) values('2009-13-99'); Query OK, 1 row affected, 1 warning (0.00 sec) mysql> show warnings; +---

RE: ibdata1 lost

2009-05-27 Thread Andrew Braithwaite
Hi, Your data is gone (unless you can undelete it from whatever filesystems you're using). You should be able to recover the schema from the directories and .frm files by doing something like this hack: 1. Take a copy of your .frm files and keep them somewhere safe. 2. Create a database with t

RE: The size of an index (INDEX_LENGTH)

2009-06-15 Thread Andrew Braithwaite
Hi, Is your table MyISAM or InnoDB? Andrew -Original Message- From: Morten [mailto:my.li...@mac.com] Sent: 15 June 2009 21:23 To: mysql@lists.mysql.com Subject: The size of an index (INDEX_LENGTH) Hi, I dropped an index on a table with 25M records today. The INDEX_LENGTH in informa

RE: Growing database & Performance

2009-06-29 Thread Andrew Braithwaite
>> Would it be beneficial to divide this database tables >> across different databases where each database holds some tables? If you are planning to scale to large amounts of database activity in the future then yes, this will help very much. If you split your tables into several logical datab

Replication - connecting a slave to a master on the same host via a port or socket

2009-08-11 Thread Andrew Braithwaite
Hi, I have 2 mysql instances running on a server on different ports with different datadirs and different .sock files. I can connect locally via the sock with the -S flag to mysql but I cannot connect locally via port (-P flag). Does anyone know if there is a way to configure a mysql slave to us

RE: Replication - connecting a slave to a master on the same host via a port or socket

2009-08-11 Thread Andrew Braithwaite
Ah. I have found that if you use 'localhost' to connect, you cannot specify a port, it silently fails... You can connect using a hostname (even though it's the same server), specifying a port... Andrew -Original Message----- From: Andrew Braithwaite [mailto:andrew.braithwa.

RE: 1 Machine with 4 GB RAM for Big Size MySQL Data Size

2009-09-05 Thread Andrew Braithwaite
One word: Backups! If your potential client must restrict you to one server then your primary consideration in this design must be backups, this cannot be stressed enough. One server with 4GB main memory should be fine for your 24GB database with small monthly growth and low number of users, you

RE: Mysql dynamic database location

2009-09-18 Thread Andrew Braithwaite
http://dev.mysql.com/doc/refman/5.1/en/server-options.html#option_mysqld _datadir You can specify the data directory at runtime with the --datadir= option to mysqld (mysqld_safe). Cheers, A -Original Message- From: vegiv...@gmail.com [mailto:vegiv...@gmail.com] On Behalf Of Johan De Mee

RE: Optimizing my.cnf

2009-10-06 Thread Andrew Braithwaite
If it's a dedicated MySQL server I would increase the key buffer to at least half the available main memory and leave the rest for filesystem cache. You'll probably get the biggest performance increase this way. Cheers, A -Original Message- From: sangprabv [mailto:sangpr...@gmail.com]

RE: Index analyser

2010-02-24 Thread Andrew Braithwaite
There's also the Query Analyser http://www.mysql.com/products/enterprise/query.html which is part of MySQL Enterprise - I've never used it and it is very expensive but I believe it will advise on optimal indicies. Cheers, Andrew -Original Message- From: Cantwell, Bryan [mailto:bcantw...@

RE: Index analyser

2010-02-24 Thread Andrew Braithwaite
You can use this to get rid of unused indicies too. http://www.mysqlperformanceblog.com/2009/01/15/dropping-unused-indexes/ Requires the percona extensions to be loaded. Cheers, Andrew -Original Message- From: Andrew Braithwaite [mailto:andrew.braithwa...@lovefilm.com] Sent: 24

Strange date behaviour

2011-03-31 Thread Andrew Braithwaite
Hi, Mysql > select curdate() + interval 6 month - interval 6 month; +-+ | curdate() + interval 6 month - interval 6 month | +-+ | 2011-03-30 | +-

Patching MySQL CLI to log information

2011-06-02 Thread Andrew Braithwaite
Has anyone ever patched the MySQL or libmysql to log to some logfiles with information like the UNIX user, time, server connected to, port etc? I'm just trying to save myself a bit of C patching. Cheers, A -

MySQL 5.0.27 replication problems

2007-09-28 Thread Andrew Braithwaite
Hi, I keep getting the below in the error log. I can't see any problems (no other errors and replication is working) and the master DB is available the whole time. 070928 12:07:31 [Note] Slave: received end packet from server, apparent master shutdown: 070928 12:07:31 [Note] Slave I/O thread:

RE: Performance problem - MySQL at 99.9% CPU

2008-01-02 Thread Andrew Braithwaite
Hi, If you can follow this document: http://www.ufsdump.org/papers/uuasc-june-2006.pdf You should be able to figure out what's happening. Cheers, Andrew -Original Message- From: Gunnar R. [mailto:[EMAIL PROTECTED] Sent: Tue, 01 January 2008 23:31 To: mysql@lists.mysql.com Subject: Pe

RE: Optimal MySQL server -- opinions?

2008-04-29 Thread Andrew Braithwaite
Hi, Three things... 1. You need to let us know what the DB server will be doing. Many CPU cores are only important of you have many CPU intensive MySQL connections in parallel. Will you have a read-intensive or write-intensive database load? Those 2950III you're considering can take up to 8 di

Looking at the MySQL binlog and pulling the queries onto one line

2008-11-21 Thread Andrew Braithwaite
Hi, I can convert the binlogs to text using mysqlbinlog and that works fine. However; I have queries that span several lines e.g. : SELECT blah FROM t1 WHERE some condition ORDER BY something Does anyone know of any utilities to reformat binlogs so that the queries are all on a singl

RE: seoparator help

2007-08-23 Thread Andrew Braithwaite
mysql> select format(300,0); +---+ | format(300,0) | +---+ | 3,000,000 | +---+ 1 row in set (0.00 sec) mysql> select format(300,2); +---+ | format(300,2) | +---+ | 3,000,000.00 | +-

thread_concurrency in linux

2007-08-24 Thread Andrew Braithwaite
Hi, Does anyone know if thread_concurrency works in linux or is it just limited to Solaris and Windows? I know the general rule is number of CPU's*2 but will this actually have any effect with Linux's threading model? Thanks for any help :) Andrew Mysql, query This message has been scanned f

thread_concurrency in linux

2007-08-29 Thread Andrew Braithwaite
Hi, Does anyone know if thread_concurrency works in linux or is it just limited to Solaris and Windows? I know the general rule is number of CPU's*2 but will this actually have any effect with Linux's threading model? Thanks for any help :) Andrew Mysql, query This message has been scanned f

RE: thread_concurrency in linux

2007-08-29 Thread Andrew Braithwaite
Hi, Just to make it clear; I mean thread_concurrency, not innodb_thread_concurrency. Cheers, Andrew From: Alex Arul Lurthu [mailto:[EMAIL PROTECTED] Sent: Wed, 29 August 2007 10:10 To: Andrew Braithwaite Cc: mysql@lists.mysql.com Subject: Re

thread_concurrency in linux

2007-08-31 Thread Andrew Braithwaite
Hi, Does anyone know if thread_concurrency works in linux or is it just limited to Solaris and Windows? I know the general rule is number of CPU's*2 but will this actually have any effect with Linux's threading model? Thanks for any help :) Andrew Mysql, query This message has been scanned f

Delays in replication and internet latency

2005-03-11 Thread Andrew Braithwaite
Hi, We have replication running here and it has been excellent for a number of years. Recently we have been having lag in replication from London to Palo Alto (Plenty of bandwidth but a latency of 300ms round trip). The replications binlogs are being written at a rate of about 100MB to 200MB

RE: Delays in replication and internet latency

2005-03-14 Thread Andrew Braithwaite
mysql@lists.mysql.com Subject: Re: Delays in replication and internet latency Hello. You may use --slave_compressed_protocol=1. See: http://dev.mysql.com/doc/mysql/en/replication-options.html "Andrew Braithwaite" <[EMAIL PROTECTED]> wrote: > Hi, > > We have replication running

MySQL inserts and disk full - how to handle gracefully?

2005-03-30 Thread Andrew Braithwaite
Hi All, When you do a insert into a MySQL database and the disk is full, the insert just hangs waiting for that table to become available. This is fine for applications that care about data integrity. In this case I care more about availability and speed and would prefer it if the inserts grac

Can't create a new thread (errno 11). If you are not out of available memory, you can consult the manual for a possible OS-dependent bug'

2005-03-30 Thread Andrew Braithwaite
Hi, I'm getting this strange error when there are more than 1100 mysql connections connected to the same server. [EMAIL PROTECTED] mysql]# bin/mysql bin/mysql: connect to server at 'localhost' failed error: 'Can't create a new thread (errno 11). If you are not out of available memory, you can con

RE: Can't create a new thread (errno 11). If you are not out of available memory, you can consult the manual for a possible OS-dependent bug'

2005-04-01 Thread Andrew Braithwaite
//dev.mysql.com/doc/mysql/en/crashing.html "Andrew Braithwaite" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm getting this strange error when there are more than 1100 mysql > connections connected to the same server. > > [EMAIL PROTECTED] mysql]# bin/mysq

MySQL inserts and disk full - how to handle gracefully?

2005-04-01 Thread Andrew Braithwaite
Hi All, When you do a insert into a MySQL database and the disk is full, the insert just hangs waiting for that table to become available. This is fine for applications that care about data integrity. In this case I care more about availability and speed and would prefer it if the inserts gracef

RE: Can't create a new thread (errno 11). If you are not out of available memory, you can consult the manual for a possible OS-dependent bug'

2005-04-07 Thread Andrew Braithwaite
e. Include the >> >> output of the following statement as well: >> >> >> >> SHOW VARIABLES; >> >> >> >> >> >> >>>I'm getting this strange error when there are more than 1100 mysql >> >> >>>connectio

Help with a tricky/impossible query...

2005-04-13 Thread Andrew Braithwaite
Hi, I need some help with a tricky query. Before anyone asks, I cannot bring this functionality back to the application layer (as much as I'd like to). Here's what I need to do... create table wibble( seq int(3) auto_increment primary key, x int(5), y int(5) ); insert into wibble set x=5, y=10

Re: Help with a tricky/impossible query...

2005-04-13 Thread Andrew Braithwaite
I should mention that I'm constrained to version 4.0.n so no sub queries for me! Andrew On 14/4/05 1:11 am, "Andrew Braithwaite" <[EMAIL PROTECTED]> wrote: > Hi, > > I need some help with a tricky query. Before anyone asks, I cannot bring > this functional

Re: Changing the Prompt for timing purposes

2005-04-13 Thread Andrew Braithwaite
When you say shell, do you mean DOS or UNIX? If it's the latter then you may do this for the logfile: sh-2.05b# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 to server version: 4.0.24-standard-log Type 'help;' or '\h' for help. Type '\c' to clear t

RE: Help with a tricky/impossible query...

2005-04-14 Thread Andrew Braithwaite
om: Paul B van den Berg [mailto:[EMAIL PROTECTED] Sent: Thu 14 April 2005 10:47 To: MySQL Cc: Andrew Braithwaite Subject: Help with a tricky/impossible query... Hi, In SQL you need to define the data that you want to work with: create table z ( z int(5) not null primary key); insert into z values

Re: Query Performance

2005-04-14 Thread Andrew Braithwaite
You could probably save a bit of processing time by changing: concat(date_format(from_unixtime(time), "%d/%m/%Y")," - ", time_format(from_unixtime(time), "%H:%i")) to: date_format(from_unixtime(time), "%d/%m/%Y - %H:%i") This would mean half the date conversions would be executed. Separating o

RE: Remove 1st 3 Chars

2005-05-11 Thread Andrew Braithwaite
Hello, Is there any way to get MySQL to return the results of this query with the 'fieldname' in the order listed in the in() bit? select fieldname from tablename where fieldname in ('B4079','B4076','B4069','B4041','A4710','58282','58220','56751','56728' ,'45003','09234','04200','04035','04026');

RE: Query to emulate what mysqldump does

2003-12-03 Thread Andrew Braithwaite
You could try to use the "select into {OUTFILE | DUMPFILE} from tablename where blah=blah..." I think you may be able to do "select into local outfile from blah" Which will put the file on the same server as the MySQL client is running on... Cheers, Andrew -Original Message- From:

RE: mysql disaster recovery

2003-12-03 Thread Andrew Braithwaite
I have had some nasty NFS experiences (especially with the server from which you're mounting the data going down). In my experience (and I'm echoing previous responses now) replication is better. Cheers, Andrew -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent:

RE: Find duplicates query

2003-12-08 Thread Andrew Braithwaite
If you do: Select concat(Fee,'some_dilimiter',Fie,'some_dilimiter',Foe), count(*) as wibble, Fee,Fie,Foe >From TableFoo Group by 1 order by 2 desc; If you want to do a "having wibble > 1" then that'll eliminate all non-duplicates from the results. You should get a nice list of duplicates ordered

RE: Avarage monthly import

2003-12-08 Thread Andrew Braithwaite
Are you using MySQL? OK, if you are then first simplify your query: select date_format(dt_imp,'%Y/%m') as date, SUM(imp) from sp group by 1 order by 1 Then add the AVG column which will work ok with the "group by" : select date_format(dt_imp,'%Y/%

A series of essays on fulltext searching.

2003-12-19 Thread Andrew Braithwaite
Hi, This isn't MySQL specific, but it's very interesting and I thought people may be interested. http://www.tbray.org/ongoing/When/200x/2003/07/30/OnSearchTOC Cheers, Andrew SQL, Query -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lis

RE: date and not null

2003-12-21 Thread Andrew Braithwaite
Not sure how the first insert worked - couldn't test it as the create table syntax is not valid - "nlandings number" and "nhours number" - not sure how they produced the schema: | nlandings | int(11) | YES | | NULL| | | nhours| double(8,2) | YES | | NULL| | I

RE: Very Slow GROUP BY Query

2003-12-21 Thread Andrew Braithwaite
Well, without investigating it too deeply, if you have: SELECT Realm, COUNT(*) AS CallCount, SUM(AcctSessionTime) AS RealmTime FROM ServiceRADIUSAccounting WHERE AcctStartTime < '2003-12-12 16:00:00' AND AcctStopTime > '2003-12-12 15:00:00' AND (Realm = 'bwsys.net') GROUP BY Realm If you are usin

RE: 100,000,000 row limit?

2003-12-23 Thread Andrew Braithwaite
I don't believe this. I'm going to write a script to disprove this theory right now.. Cheers, Andrew -Original Message- From: Paul DuBois [mailto:[EMAIL PROTECTED] Sent: Tuesday 23 December 2003 20:08 To: Andres Montiel; [EMAIL PROTECTED] Subject: Re: 100,000,000 row limit? At 0:57 -

RE: Read Slaves, and load balancing between them...

2004-01-29 Thread Andrew Braithwaite
Hi, I employ a simple method, I have a 'status' table on the master and have a cron job that updates this table with the current time (now()) every minute. I test all the slaves each minute and if the time in the status table gets too far behind the actual time then it flags a warning to me. Chee

RE: Read Slaves, and load balancing between them...

2004-01-29 Thread Andrew Braithwaite
EMAIL PROTECTED] Subject: Re: Read Slaves, and load balancing between them... On Thu, Jan 29, 2004 at 03:40:17PM -0000, Andrew Braithwaite wrote: >Hi, > >I employ a simple method, I have a 'status' table on the master and >have a cron job that updates this table with the c

RE: Advise on High Availability configuration

2004-02-01 Thread Andrew Braithwaite
Hi, In answer to your questions: > - Have any of you seen such a configuration being > deployed? No, when we implemented high-availability MySQL servers we used MySQL's inbuilt replication - this has been running here for years now and we have had constant DB availability during that time, ev

RE: images from MySQL backend used with MS-Access 2000 frontend

2004-02-01 Thread Andrew Braithwaite
I would recommend storing the images on the filesystem and put the information about those images (along with the path to the image) in MySQL. If you plan to have lots of images, implement a nice logical directory structure to keep them in as in my experience linux ext2/3 is fast reading/writing fi

RE: Multiple values in the host field

2004-02-01 Thread Andrew Braithwaite
Hi, > In myuser table, I have something like this: > | Php.me.com | database_name | You could use a wildcard like this: | %.me.com | database_name | This would allow any the user to connect from any subdomain on the me.com domain. However it would mean that other servers (e.g. wibble.me.com

RE: Query problem

2004-02-01 Thread Andrew Braithwaite
Hi, You need: select job,avg(sal) from emp group by 1 order by 2 limit 1; Cheers, Andrew -Original Message- From: Edouard Lauer [mailto:[EMAIL PROTECTED] Sent: Saturday 31 January 2004 19:23 To: [EMAIL PROTECTED] Subject: Query problem Hello, I would like to query the littlest aver

RE: Slave crashed: error 'The table 'users' is full' on query..

2004-02-01 Thread Andrew Braithwaite
Hi, Whilst you may have space on the box, you may have reached a file size limit on whatever OS you're using (on some linux versions, the max size of a file in 4GB and similar on some windows versions) It may also be a mysql limit on data length. Check the status of your table like this: mysql>

RE: 5.0 replication and stored procedure

2004-02-01 Thread Andrew Braithwaite
Hi, 5.0 is "sub-alpha" at the moment. If you think there is a problem, go to http://bugs.mysql.com/ Cheers, Andrew -Original Message- From: William Au [mailto:[EMAIL PROTECTED] Sent: Friday 30 January 2004 22:35 To: [EMAIL PROTECTED] Subject: 5.0 replication and stored procedure Doe

RE: MySQL optimisations for search engine

2004-02-01 Thread Andrew Braithwaite
Hi, Make sure the words.word field is indexed and that the pages.id is an indexed primary key. Cheers, Andrew -Original Message- From: Jasper Bryant-Greene [mailto:[EMAIL PROTECTED] Sent: Friday 30 January 2004 21:39 To: [EMAIL PROTECTED] Subject: MySQL optimisations for search engine

RE: Multiple mysql servers with the same datadir

2004-02-01 Thread Andrew Braithwaite
Hi, I think you're getting mixed up between DBD (data base driver) and BDB (BerkeleyDB) but I reckon you mean BDB... I'm not sure if the locking of the page (i.e. the whole table file) is done at the filesystem level or is managed internally by each mysqld instance. If it is managed by each mysql

RE: Advise on High Availability configuration

2004-02-02 Thread Andrew Braithwaite
Hi, OK - I'll try to explain in as much detail as I can.. We have redhat linux apache webservers running our apps with fcgi (which uses persistant DB connections). We have about 8 of these. It's important to understand that our MySQL system is optimised for a read-heavy / write-light site (abo

RE: Multiple mysql servers with the same datadir

2004-02-02 Thread Andrew Braithwaite
Hi, > But when runing multiple myisam & enable-external-locking database > servers with the same NFS datadir, will there be any deadlock problems? I have no experience in this but it sounds like it may cause problems. > I wonder if it is possible to use NFS as the storage backend and > to prov

RE: Advise on High Availability configuration

2004-02-02 Thread Andrew Braithwaite
MAIL PROTECTED] Subject: RE: Advise on High Availability configuration Andrew Braithwaite wrote: > Each slave keeps a heartbeat to the master and in the event of a > failure, changes it's master to master2. So how does this bit work? If one master falls over and slaves move to ma

RE: Insert query

2003-06-01 Thread Andrew Braithwaite
Hi, I would use mediumint rather than int for the ID column (int has support for up to 2.1 Billion records wheras mediumint is up to 8.3 million - more efficient for your data type). I don't think the varchar will cause much of a problem. Useful section here: http://www.mysql.com/doc/en/Data_si

RE: table copying/replication

2003-06-04 Thread Andrew Braithwaite
Hi, Assuming that this system runs on *nix and that "prod" is set up to replicate to all the "replicas" you could write a small bash script to push the data from the "stage" to the "prod" which would then replicate as normal. I would author the script something like this... [bash]# mysqldump -e

RE: table copying/replication

2003-06-04 Thread Andrew Braithwaite
n you could set up a nfs mount or something to let your scripts do the copying (I wouldn't recommend nfs for large amounts of fast data transfer personally...) Hope this helps... Andrew -Original Message- From: Ross Simpson [mailto:[EMAIL PROTECTED] Sent: Tuesday 03 June 2003 23:5

RE: MySQL Mirroring.

2003-06-04 Thread Andrew Braithwaite
Assuming that you speak english - you can do the following... http://www.mysql.com/doc/en/Replication.html Cheers, Andrew -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday 04 June 2003 00:24 To: [EMAIL PROTECTED] Subject: MySQL Mirroring. Hi, Pleas

RE: Hmm looks like this query works

2003-06-10 Thread Andrew Braithwaite
Try this instead... SELECT val_column, 0.1+RAND() as rand_col from TABLE ORDER BY rand_col limit 10; Cheers, A -Original Message- From: Eric Wagner [mailto:[EMAIL PROTECTED] Sent: Tuesday 10 June 2003 21:36 To: Dathan Vance Pattishall; [EMAIL PROTECTED] Subject: RE: Hmm looks like this

RE: Hmm looks like this query works

2003-06-10 Thread Andrew Braithwaite
Ah - I missed the weighting requirement - forget my last post then... You could try increasing the "0.1" weighting factor until it gave you the required result instead.. Cheers, Andrew -Original Message- From: Eric Wagner [mailto:[EMAIL PROTECTED] Sent: Tuesday 10 June 2003 21:36 To: D

RE: empty a table

2003-06-10 Thread Andrew Braithwaite
Hi, If you want this to run faster, you can use the 'truncate table' syntax as explained here: http://www.mysql.com/doc/en/TRUNCATE.html Cheers, Andrew -Original Message- From: Roger [mailto:[EMAIL PROTECTED] Sent: Tuesday 10 June 2003 23:01 To: Fabio Bernardo Cc: [EMAIL PROTECTED] S

RE: Group by and Count query

2003-06-11 Thread Andrew Braithwaite
You could do the following: select host,count(*) as counthost from TABLE_HOST group by 1 having counthost = 1; Which will list all the hosts with only 1 record.. Then get the "numrows" from that query to find uot how many there are.. Cheers, Andrew -Original Message- From: Mithun Bhat

RE: binary log

2003-06-11 Thread Andrew Braithwaite
In order to help, could you post some info about both servers config (cpu speed, disk speed and OS as well as network capacity) - That would really help people understand the problem and find the bottleneck... Cheers, A -Original Message- From: Sam Jumper [mailto:[EMAIL PROTECTED] Sent:

RE: Replication troubles

2003-06-13 Thread Andrew Braithwaite
>In the case of both the master and the slave the max_allowed_packet is set to 1047552. In both cases I raised it to 2047552 just to be generous. In order for changes to the max_allowed_packet to take effect, you'll need to restart mysqld on that server. Cheers, Andrew -Original Message

RE: Relocating the datadir

2003-06-30 Thread Andrew Braithwaite
Hi, You could either pass it as an attribute to the command line mysqld or specify it in your my.cnf : http://www.mysql.com/doc/en/Command-line_options.html Or logical link the /usr/local/mysql/data to some other filesystem (ln -s) Cheers, Andrew -Original Message- From: Claudio Alonso

RE: date format

2003-07-01 Thread Andrew Braithwaite
mysql> select date_sub(curdate(), interval 1 day) as wibble; ++ | wibble | ++ | 2003-06-30 | ++ 1 row in set (0.00 sec) -Original Message- From: Fabio Bernardo [mailto:[EMAIL PROTECTED] Sent: Tuesday 01 July 2003 15:32 To: Mysql (E-mail) Subject: d

Replication bin log rollover....

2003-07-07 Thread Andrew Braithwaite
Hi, I have a MySQL master server doing huge amounts of inserts and updates. I'm rapidly reaching the point where my binlogs will get to: myserver-bin.999 Does anyone know if MySQL treats the rollover gracefully? Will it rollover to myserver-bin.001 or will it move to a 4 figure extension? I c

RE: Select not producing desired results

2003-07-09 Thread Andrew Braithwaite
Hi, If you send a table def (mysqldump would be good) I will be able to experiment and come up with an answer... Cheers, Andrew -Original Message- From: Patrick Shoaf [mailto:[EMAIL PROTECTED] Sent: Wednesday 09 July 2003 20:30 To: [EMAIL PROTECTED] Subject: Select not producing desire

MySQL performance question..

2003-07-09 Thread Andrew Braithwaite
Hi, Can anyone help? I'm running a server with a Pentium 133 w/32meg ram, 512 pipeline burst, with a wd 512MB HD and I want to store George Bush in our MySQL database. As far as table definitions are concerned, should I use a BLOB or should I store him on disk and make a reference to the physi

RE: Recomended RAM for production server. 3Gb overboard?

2003-07-10 Thread Andrew Braithwaite
> The db directory is 80mb total > handling 14 requests/s with all queries being simple INSERT or SELECT's. 1GB ram should be more than enough for your needs. If you are doing lots of the same kind of selects, I would dedicate a good chunk of that memory to MySQL query caching (maybe 64MB ish).

RE: Pull updated Records without a date field?

2003-07-10 Thread Andrew Braithwaite
> Is there a way to pull all updated records without having a date field in each record? No. Generally speaking it's a good idea to have a timestamp field in these oft updated tables to perform just the kind of operation you describe. Cheers, Andrew -Original Message- From: Keith Hamilt

RE: Turn off log-bin without restarting database

2003-07-10 Thread Andrew Braithwaite
Hi, If you are using unix, comment out those lines and set a cron job for 2am to do the server restart for you... If you're using windows then comment out the lines and set ?schedule? (or whatever the ms equiv is) to do the restart at 2am. Cheers, Andrew -Original Message- From: Ian Co

RE: MySQL 3 and 4 side by side?

2003-07-10 Thread Andrew Braithwaite
There is a doc on it here: http://mysql.us.themoes.org/doc/en/Installing_many_servers.html (the same page on www.mysql.com/doc seems to have gone missing!!) Cheers, Andrew -Original Message- From: James B. Wetterau Jr. [mailto:[EMAIL PROTECTED] Sent: Thursday 10 July 2003 23:28 To: [EM

RE: ORDER BY with Date Format

2003-07-10 Thread Andrew Braithwaite
Try: order by left(start_date,7) That will order by year then month for a standard date column.. Cheers, Andrew -Original Message- From: Mike At Spy [mailto:[EMAIL PROTECTED] Sent: Thursday 10 July 2003 20:51 To: [EMAIL PROTECTED] Subject: ORDER BY with Date Format I am trying to c

  1   2   >