Re: auto_increment and the value 0

2006-03-29 Thread Simon Garner
On 30/03/2006 12:31 p.m., Daniel Kasak wrote: [EMAIL PROTECTED] wrote: I suppose that would be alot easier than trying to bump the PK and related FK values of the whole table by 1, just to give the first row in the table the auto_increment value of 1? Yes. That sounds messy. What about be

Re: auto_increment syntax

2006-03-23 Thread Simon Garner
On 24/03/2006 11:06 a.m., Eric Beversluis wrote: Can someone illustrate the correct syntax for using auto_increment in making a table? I've studied the manual and I'm not seeing how it comes out. EG: CREATE TABLE Books ( bookID INT(5) PRIMARY KEY AUTO_INCREMENT... THEN WHAT? Thanks. EB

Re: Signal 11 crashes on MySQL V5

2006-03-09 Thread Simon Garner
On 9/03/2006 9:43 a.m., Kishore Jalleda wrote: could you tell us if these 6 are in a cluster or in a replication set up, and u also said the 3 linux bixes all crash at once, did u check the logs, do they crash under load, what about the OS, is it stable when mysql crashes Kishore Jalleda

Re: Signal 11 crashes on MySQL V5

2006-03-08 Thread Simon Garner
On 9/03/2006 8:42 a.m., Dave Pullin wrote: I am running MySQL on 6 servers - 3 Linux and 3 Windows. I recently upgraded to V5 on all servers. Now MySQL is crashing regularly (several times per day, some days) with 'got signal 11'. My 3 Linux servers are very different machines running different

Re: Using Network Block Device on Linux to build HUGE/cheap memory-base MySQL boxes.

2006-02-20 Thread Simon Garner
On 19/02/2006 10:57 p.m., Kevin Burton wrote: I was talking to a friend tonight about how they use NBD to run a single system image in memory. NBD (Network Block Device) allows one Linux box to export a block device and for you to mount it on another filesystem. For the memory component the

Re: ERROR 2003 (HY000): Can't connect to MySQL server on 'gandalf' (111)

2005-12-04 Thread Simon Garner
On 5/12/2005 11:56 a.m., Mike Smith wrote: Hi, Hi, I've already check my /etc/my.cnf file for a "binding" line. Its not there. I also found an item online that indicated adding: Look for the option "skip-networking". This disables TCP/IP so the server only accepts local connections v

Re: LEFT JOIN not working on 5.0.16 - urgent help

2005-11-23 Thread Simon Garner
On 24/11/2005 2:22 p.m., Terence wrote: SELECT um.username,rm.role_name,dm.department_name FROM user_master um, role_master rm LEFT JOIN department_master dm ON um.department_id = dm.department_id WHERE um.role_id = rm.role_id; 1054 - Unknown column 'um.department_id' in 'on clause' Query: S

Re: Active user sessions

2005-10-30 Thread Simon Garner
On 31/10/2005 3:43 p.m., Cabbar Duzayak wrote: Hi, Is there a way of listing all the active db sessions and their IP addresses and/or db user names? Something like v$session in oracle? Thanks... SHOW PROCESSLIST; -Simon -- MySQL General Mailing List For list archives: http://lists.mysql.co

Re: Shifting dates

2005-06-21 Thread Simon Garner
On 21/06/2005 6:55 p.m., Sebastian wrote: i never understand why people use datetime anyway.. unix timestamp is so much easier to work with. Because DATETIME is stored natively as a date and time, which means you can then use the date and time SQL functions with them (such as DATE_ADD, DATE

Re: Shifting dates

2005-06-20 Thread Simon Garner
On 21/06/2005 2:45 p.m., Scott Haneda wrote: I need to run a BETWEEN select where I put in a date rate, the time was at one point irrelevant, but now the client is in a new time zone +3 hours ahead, so BETWEEN 2005010100 AND 20051201235959 is what I pass in now, which is wrong, how can I a

Re: idepontent inserts? Allowing INSERT to fail faster than SELECT/INSERT

2005-06-14 Thread Simon Garner
On 15/06/2005 11:22 a.m., Kevin Burton wrote: Simon Garner wrote: I'm not entirely clear what you're talking about, but you could also have a look at INSERT IGNORE..., or INSERT... ON DUPLICATE KEY UPDATE, or REPLACE INTO...: The problem is that I do NOT want it to update. Also

Re: idepontent inserts? Allowing INSERT to fail faster than SELECT/INSERT

2005-06-14 Thread Simon Garner
On 15/06/2005 10:28 a.m., Kevin Burton wrote: I've been thinking about this for a while now. If you have an app that can compute a unique key (hashcode) and you have a unique index it should be possible to just do an INSERT instead of a SELECT first to see if the record doesn't exist and then

Re: CASE .. WHEN .. returns NULL

2005-06-09 Thread Simon Garner
Alvaro Cobo wrote: Hi guys: I am here again asking for your generous and wise advise: I have a table (tbl_f4Granjas) with the information of some farms, their whole land extension (field: GraExtUPA) and the portion of the land they are managing in an agro-ecological way (field: GraExtPredio).

Re: If statment in query

2005-06-04 Thread Simon Garner
Sebastian wrote: I have two fields: topic | title topic does not always have data in it, so i want to select `title` when `topic` is null.. i thought i could do this (does not work): IF(title IS NULL, topic, title) AS heading Thanks. Try SELECT IFNULL(title, topic) AS heading -Simon -

Re: Sync 2 live MySQL Databases

2005-05-25 Thread Simon Garner
On 26/05/2005 6:40 p.m., Cecil Brand wrote: Hi, I was wandering if anyone know of a stable and reliabile way to sync 2 live mysql databases, both ways. I know I can use a master and slave, and yes have setup a few without any problem, but as all of us know this is just a one way downstream sync.

Re: Using AVG

2005-05-18 Thread Simon Garner
Mike Blezien wrote: Hello, when using the AVG function like this: SELECT AVG((5+8+10)/3) AS rate; it returns NULL?? the AVG can be used to do a literal math calculation ?? TIA That doesn't make any sense... AVG is a GROUP BY function. If you have 3 rows with values 5, 8 and 10 then surely S

Re: Different TIMESTAMP columns

2005-05-18 Thread Simon Garner
Lieven De Keyzer wrote: mysql> CREATE TABLE bookmark ( -> bookmark_id INTEGER NOT NULL AUTO_INCREMENT, -> bookmarkname VARCHAR (80) NOT NULL, -> url VARCHAR (150) NOT NULL, -> folder_id INTEGER NOT NULL, -> last_scanned DATETIME DEFAULT NOW(), -> last_notified DATETIME

Re: Different TIMESTAMP columns

2005-05-18 Thread Simon Garner
Lieven De Keyzer wrote: But how do I initialize the 2 datetime fields? With no DEFAULT, their values are -00-00 00:00:00. Just what I wanted to avoid with TIMESTAMP Set their value to NOW() if you want the current date/time. -Simon -- MySQL General Mailing List For list archives: http://lists

Re: Replication with failover

2005-05-18 Thread Simon Garner
Kevin Burton wrote: Gleb Paharenko wrote: Hello. I don't remember solutions with keepalived, but this issue is discussed in the list from time to time. Search in archives at: http://lists.mysql.com/mysql Someone should create a wiki page on this subject... its a commonly asked question... Kev

Replication with failover

2005-05-17 Thread Simon Garner
Hi, Anybody have any experience with setting up MySQL replication with dynamic failover, preferably using keepalived (http://www.keepalived.org)? What we need is a system so that if the master server dies one of the slaves will become the master. It looks like it should be possible, and merely

Re: select count(*) table

2005-05-13 Thread Simon Garner
[EMAIL PROTECTED] wrote: I have a curious situation I was hoping someone could shed some light on. mysql> select count(*) table; +---+ | table | +---+ | 0 | +---+ 1 row in set (0.00 sec) mysql> select count(*) from table; +--+ | count(*) | +--+ |25965 | +

Re: beginner guide

2005-05-09 Thread Simon Garner
On 10/05/2005 1:29 p.m., ganesan malairaja wrote: ./configure --prefix=/usr/local/mysql it returns this This is a MySQL binary distribution. It's ready to run, you don't need to configure it! which Mysql distribution do i use .. to follow the instruction from http://www.linuxhelp.net/guides/lamp/

Re: amPiguous!

2005-05-06 Thread Simon Garner
On 7/05/2005 11:00 a.m., Rhino wrote: Actually, the error message is misleading. There is nothing that I would call ambiguous in your query: you have a syntax error. The join should be written: select pk from a inner join b on a.col1 = b.col2 Of course, you need to replace 'a.col1' and 'b.col2'

Re: no /tmp/mysql.sock

2005-05-05 Thread Simon Garner
On 6/05/2005 4:18 p.m., Mark Sargent wrote: Ok, I just took a punt, and changed the setting in my.cnf to reflect the config settings, to /tmp/mysql.sock, and all is well. What I don't un, is, why the default settings were like this, I certainly made no changes to either the configs or the my.cnf

Re: no /tmp/mysql.sock

2005-05-05 Thread Simon Garner
Mark Sargent wrote: Hi All, mysql is running, but, there seems to be no /tmp/mysql.sock file. How is this file generated..? I can't connect, keep getting errors. What about via a port..? What is the argument for that..? Cheers. Mark Sargent. It's probably not in /tmp any more. Try /var/lib/mysql

Re: ERROR 1251: Client does not support authentication protocol requested by server; consider upgrading MySQL client

2005-05-01 Thread Simon Garner
On 2/05/2005 6:05 p.m., Mark Sargent wrote: Hi All, master/client are the same machine. I installed via tar.gz, ver 4.1 following this page http://dev.mysql.com/doc/mysql/en/installing-binary.html for installation on FC3. Why would it say that the client doesn't support it.? Cheers. P.S. I now

Re: ERROR 1251: Client does not support authentication protocol requested by server; consider upgrading MySQL client

2005-05-01 Thread Simon Garner
On 2/05/2005 5:21 p.m., Mark Sargent wrote: Hi All, I did this below, mysql>SET PASSWORD FOR 'root'@'localhost' = PASSWORD('whatafraka'); and then tried logging on, [EMAIL PROTECTED] bluefish-1.0]# mysql -h localhost -u root -pwhatafraka ERROR 1251: Client does not support authentication protocol r

Re: many to many

2005-04-20 Thread Simon Garner
On 21/04/2005 3:36 p.m., Perry Merritt wrote: Hi, I'm a novice. Hi Perry, I've designed a database that supports many to many relationships (actually many to many to many) and I need help creating the query to find my data. I know things like JOINs exist, but don't have a clue how to use them.

Multi-master replication / clustering

2005-04-12 Thread Simon Garner
Hello, I am working on a web application (php) that will have a largish mysql database (millions of rows, eventually), and for which high availability will be important. I am wondering if anyone here can suggest options for multi-master replication or clustering. The application will be mostly