Replication with failover

2005-05-18 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 involves a bit of 
scripting to glue it all together, but I was hoping somebody would have 
created such scripts already so I don't screw it up myself :)

tia
-Simon
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: varchar(10) to decimal

2005-05-18 Thread mfatene
Hi,
to convert '16.00' to 16.00, you can use select '16.00'+0
mysql select '16.00'+0;
+---+
| '16.00'+0 |
+---+
|16 |
+---+
1 row in set (0.08 sec)

for ur columns, select col+0 from tbl;


Mathias

Selon Jerry Swanson [EMAIL PROTECTED]:

 I need to change format from varchar(10) to decimal.
 When I alter the table the data is trimmed.

 What I'm doing wrrong?

 TH

 --
 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: Export from Access

2005-05-18 Thread EP
I recently exported a large Access database to MySQL using MyODBC.

It took me a while to figure out that MyODBC was the thing to try, but once I 
did tried it, it only took me a few minutes to do the export.  I highly 
recommend that approach (MyODBC).

-Eric



 Original Message
 From: Josh Trutwin [EMAIL PROTECTED]
 To: mysql@lists.mysql.com
 Date: Tue, May-17-2005 10:19 AM
 Subject: Re: Export from Access

 On Tue, 17 May 2005 17:17:31 +0100
 S.D.Price [EMAIL PROTECTED] wrote:
 
  Hi,
  can anyone explain how I would export a database created in Access
  to MySQL using PHPMyAdmin - I can't seem to import the data as csv
  or txt.
 
 Acess should allow exporting to CSV.  Otherwise you can skip
 phpMyAdmin and just use ODBC - check out MyODBC on mysql.com.
 
 Josh
 
 -- 
 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 Administrator Broke MySQL

2005-05-18 Thread Jeff Gojkovich
Nevermind.  I figured it out.  It somehow corrupted the db table in the 
mysql db.  I blew that away and recreated it with just root access to all of 
the dbs and it works now.


First I would like to start off by saying I am a complete noobie to MySQL.
I have MySQL 4.0 running on a freebsd machine.  All was fine and dandy 
till I tried to connect to it using the W32 MySQL Administrator tool.  Now 
if I try and execute a script against it I get DBI connect failed : 
Access denied for user: '[EMAIL PROTECTED]'.  I can get my scripts to work 
if I start mysql with ./safe_mysqld --skip-grant-tables .  That will let 
the scripts run until I try and change any users privs or passwords.  I 
have noticed that when I run mysql with the --skip-grant-tables flag I get 
all of my dbs showing in mysqlshow, and as soon as I try and change a user 
it changes to just showing just a test db when I execute mysql show.
./mysqlshow
+---+
| Databases |
+---+
| bayesspam |
| bulletin  |
| count |
| mysql |
| policyd   |
| radius|
| test  |
| users |
+---+
./mysqlshow
+---+
| Databases |
+---+
| test  |
+---+

Please give me some pointers on where to go to fix this.  I have googled 
and searched the archives and I haven't come up with anything that works.

--Jeff
--
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: Need help in locating configuration file

2005-05-18 Thread David Logan
http://dev.mysql.com/doc/mysql/en/mysql-config.htmle=9888

If you have questions, try http://dev.mysql.com/doc/mysql/en/index.html
first as you will often find the answer there. BTW this manual is for the
latest version that you are using.

 Hi,
 Iam using Mysql5.04
 What does it mean,

 To install the mysqli extension for PHP, use the
 --with-mysqli=mysql_config_path/mysql_config
 configuration option where mysql_config_path
 represents the location of the mysql_config
 program that comes with MySQL versions greater
 than 4.1.

 in this,is mysql_config file is same as my.ini and
 the path to it in windows 2000 NT (on my system is
 )c:\Program Files\mysql\mysql server 5.0 ; is it
 correct, then after editing the php.ini file why
 doesnot it is working.

 Any help is welcome.

 Thanks
 Sreedhar



 __
 Do you Yahoo!?
 Read only the mail you want - Yahoo! Mail SpamGuard.
 http://promotions.yahoo.com/new_mail

 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:
 http://lists.mysql.com/[EMAIL PROTECTED]




-- 
David Logan
South Australia

when in trouble, or in doubt
run in circles, scream and shout


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: varchar(10) to decimal

2005-05-18 Thread Philippe Poelvoorde
Jerry Swanson wrote:
I need to change format from varchar(10) to decimal. 
When I alter the table the data is trimmed.

What I'm doing wrrong?
TH
ALTER TABLE your_table MODIFY your_column double NOT NULL DEFAULT '0.0';
should normally work. What is the command you are doing and have you 
example results ?
How did you declare your decimal column ?

--
Philippe Poelvoorde
COS Trading Ltd.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: varchar(10) to decimal

2005-05-18 Thread Jerry Swanson
decimal(6,2)

On 5/18/05, Philippe Poelvoorde [EMAIL PROTECTED] wrote:
 Jerry Swanson wrote:
 
  I need to change format from varchar(10) to decimal.
  When I alter the table the data is trimmed.
 
  What I'm doing wrrong?
 
  TH
 
 
 ALTER TABLE your_table MODIFY your_column double NOT NULL DEFAULT '0.0';
 should normally work. What is the command you are doing and have you
 example results ?
 How did you declare your decimal column ?
 
 --
 Philippe Poelvoorde
 COS Trading Ltd.
 
 --
 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 Chinese+ 2.0beta

2005-05-18 Thread 崔屹
I recently find a way out of mysql's chinese fulltext index bug.
Moreover, I use hylanda's word segment library to optimize the fulltext
performance. Any tryout is welcome and I am looking forward to your
suggestion. TIA.

You can download MySQL Chinese+ 2.0beta from

http://www.hylanda.com/cgi-bin/download/count.asp?id=9url=1

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: MySQL Administrator Broke MySQL

2005-05-18 Thread Gleb Paharenko
Hello.



First read:



  http://dev.mysql.com/doc/mysql/en/privilege-system.html



After that change the password and grants for [EMAIL PROTECTED] 













Jeff Gojkovich [EMAIL PROTECTED] wrote:

 First I would like to start off by saying I am a complete noobie to MySQL.

 I have MySQL 4.0 running on a freebsd machine.  All was fine and dandy till 

 I tried to connect to it using the W32 MySQL Administrator tool.  Now if I 

 try and execute a script against it I get DBI connect failed : Access 

 denied for user: '[EMAIL PROTECTED]'.  I can get my scripts to work if I 
 start 

 mysql with ./safe_mysqld --skip-grant-tables .  That will let the scripts 

 run until I try and change any users privs or passwords.  I have noticed 

 that when I run mysql with the --skip-grant-tables flag I get all of my dbs 

 showing in mysqlshow, and as soon as I try and change a user it changes to 

 just showing just a test db when I execute mysql show.

 ./mysqlshow

 +---+

 | Databases |

 +---+

 | bayesspam |

 | bulletin  |

 | count |

 | mysql |

 | policyd   |

 | radius|

 | test  |

 | users |

 +---+

 ./mysqlshow

 +---+

 | Databases |

 +---+

 | test  |

 +---+

 

 Please give me some pointers on where to go to fix this.  I have googled and 

 searched the archives and I haven't come up with anything that works.

 

 

 --Jeff 

 

 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
   ___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Replication with failover

2005-05-18 Thread Gleb Paharenko
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







Simon Garner [EMAIL PROTECTED] wrote:

 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 involves a bit of 

 scripting to glue it all together, but I was hoping somebody would have 

 created such scripts already so I don't screw it up myself :)

 

 tia

 -Simon

 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
   ___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Installing MySQL 4.1.12 on Mandrake 10.1

2005-05-18 Thread Gleb Paharenko
Hello.



My questions are: Is there other files besides just the server 
 and

the client

that I would need to install to get MySQL to work on Mandrake

v10.1?  



Your data directory should contain mysql database prepared with

mysql_install_db script. See:



  http://dev.mysql.com/doc/mysql/en/unix-post-installation.html



   Are there other issues with 4.1.12 that I have not 
 fully explored

   that might

   prevent this from being installed? 



In your case - no.





Finally if I upgraded this system to 4.1.12 now that 
 4.0.20 is

installed

would I wind up having the same problems? 

 





You should read:



  http://dev.mysql.com/doc/mysql/en/upgrading-from-4-0.html



But I suggest you to remove all mysql instances from you box and perform

a clean install of 4.1.12 using official binaries.









 I have a new test Linux server with Mandrake 10.1 installed that I was

 trying

 to install MySQL version 4.1.12 on today.

  

   Once I had installed the software, whenever I tried to start MySQL on

   this

   server I was getting the error message [ERROR] Fatal error: Can't

   open

   privilege tables: Table 'mysql.host' doesn't exist when I tried to

   run the

   'mysql_setpermissions' script and was getting the same result. 



After this failed I decided to try the MySQL installation files that

came

with the operating system which were Version 4.0.20 and this version

worked

fine. 

 

   When I was installing the 4.1.12 version I was simply going 
 with a

   minimal

   install of just the server package and the clients. When I ran 
 the

   installation package from Mandrake it installed other files that

   from my

   reading of the MySQL manual I did not think that I needed. 



My questions are: Is there other files besides just the server 
 and

the client

that I would need to install to get MySQL to work on Mandrake

v10.1?  

 

   Are there other issues with 4.1.12 that I have not 
 fully explored

   that might

   prevent this from being installed? 



Finally if I upgraded this system to 4.1.12 now that 
 4.0.20 is

installed

would I wind up having the same problems? 

 



Eric Lommatsch [EMAIL PROTECTED] wrote:



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
   ___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Need help in locating configuration file

2005-05-18 Thread Gleb Paharenko
Hello.



 in this,is mysql_config file is same as my.ini and



On Unix mysql_config reports various settings that may

be needed when using the MySQL client library. Read in

the PHP documentation how to install extensions for Windows 

binaries of PHP.













madderla sreedhar [EMAIL PROTECTED] wrote:

 Hi,

 Iam using Mysql5.04

 What does it mean,

 

 To install the mysqli extension for PHP, use the 

 --with-mysqli=mysql_config_path/mysql_config

 configuration option where mysql_config_path

 represents the location of the mysql_config

 program that comes with MySQL versions greater

 than 4.1.

 

 in this,is mysql_config file is same as my.ini and

 the path to it in windows 2000 NT (on my system is

 )c:\Program Files\mysql\mysql server 5.0 ; is it

 correct, then after editing the php.ini file why

 doesnot it is working.

 

 Any help is welcome.

 

 Thanks

 Sreedhar

 

 



 __ 

 Do you Yahoo!? 

 Read only the mail you want - Yahoo! Mail SpamGuard. 

 http://promotions.yahoo.com/new_mail 

 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
   ___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: mysql database problems

2005-05-18 Thread Gleb Paharenko
Hello.



 with php scripts.  Now I am getting the message Unable to load database

 indicated by configuration file or something similiar when trying to connect 
 to

 any database running on the server when the mysql user is running @localhost. 



Please, send the exact error messages and warnings. If you are able to

connect using mysql command line client then this is rather a php issue.





Dwayne Hottinger [EMAIL PROTECTED] wrote:

 Greetings all,

 Im new to mysql and have inherited several mysql databases and everything has

 been going well until lately.  Most of my webpages come from mysql databases

 with php scripts.  Now I am getting the message Unable to load database

 indicated by configuration file or something similiar when trying to connect 
 to

 any database running on the server when the mysql user is running @localhost. 

 I can however login at terminal as the mysql user and look at the database 
 with

 no problems.  My mysql version is  3.23.58 (upgraded from yum), php version

 4.3.10, server is Fedora Core 2 kernel 2.6.5-1.358smp.  Im pretty new to mysql

 so be gentle and easy in any help.  Everything was working fine prior to 
 Friday

 of last week.  Mysqld.log show nothing other than start and restarts that I

 initiated trying to get things working.

 

 

 thanks,

 

 ddh

 

 

 --

 Dwayne Hottinger

 Network Administrator

 Harrisonburg City Public Schools

 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
   ___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: repair table/close table ?????

2005-05-18 Thread Gleb Paharenko
Hello.



Apart from this

 brightmail.din_top_spam

 warning  : 1 clients is using or hasn't closed the table properly

 status   : 



After what command have you got the warning? CHECK TABLE shouldn't

produce it:



  http://dev.mysql.com/doc/mysql/en/myisamchk-syntax.html



If mysqld is running, you must force it to flush any table

modifications that are still buffered in memory by using FLUSH TABLES.

You should then ensure that no one is using the tables while you are

running myisamchk. The easiest way to avoid this problem is to use

CHECK TABLE instead of myisamchk  to check tables.











Seena Blace [EMAIL PROTECTED] wrote:



 [-- text/plain, encoding 7bit, charset: us-ascii, 27 lines --]

 

 Hi,

 

 Here is what I see.

 mysql check table report_1;

 +---+---+--++

 | Table | Op| Msg_type | Msg_text 
   |

 +---+---+--++

 | mailtest.report_1 | check | error| record delete-link-chain corrupted |

 | mailtest.report_1 | check | error| Corrupt|

 +---+---+--++

 2 rows in set (0.02 sec)

 

 Does repair  table report_1 command fix?

 or anything we need to do extra?

 

 Apart from this 

 brightmail.din_top_spam

 warning  : 1 clients is using or hasn't closed the table properly

 status   : OK

 How to close such kind of table?

 thanks

 

 



 -

 Yahoo! Mail Mobile

 Take Yahoo! Mail with you! Check email on your mobile phone.



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
   ___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: mysql - Client does not support authentication protocol requested by server

2005-05-18 Thread Gleb Paharenko
Hello.



See:

  http://dev.mysql.com/doc/mysql/en/old-client.html





ymarkiv [EMAIL PROTECTED] wrote:

 Dear all, 

 

 I'm mysql newbie. 

 

 When I try to connect to mysql using php script, it answers: 

 

 Warning: mysql_connect(): Client does not support authentication 

 protocol requested by server. Consider upgrading MySQL client 

 in /usr/local/www/data-dist/grad-web/email.php on line 18 

 

 It talks about line 18 of my email.php script, which is

 

 MYSQL_CONNECT($hostname,$username,$password);

 

 So how do I set the proper authentication protocol requested by server? 

 

 MySQL version is 4.1.0-alpha 

 OS is FreeBSD 5.2

 

 Best regards, 

 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
   ___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



4.1.12 Crashing on Mandrake 10.1

2005-05-18 Thread Mark Hughes
Hi,

I just upgraded from 4.1.11 (which worked fine, and stil does if I
downgrade) to 4.1.12 and the first query crashes the server. This
query is executed via DBD::mysql, when run via the mysql client it
works OK though. I presume this must be some library conflict but has
anyone got any idea what?

I tried to follow these instructions:

http://dev.mysql.com/doc/mysql/en/using-stack-trace.html

But there isn't a mysqld.sym.gz and nm -n mysqld  /tmp/mysqld.sym
(and nm -n -D ) says nm: mysqld: no symbols

Error Log
--
mysqld got signal 11;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=268435456
read_buffer_size=1044480
max_used_connections=2
max_connections=100
threads_connected=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size +
sort_buffer_size)*max_connections = 466543 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd=0x892bba0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0xbfe7eaf8, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x808df77
0x82e8af8
0x808bd1e
0x80b3fe1
0x80a2c14
0x809d0f2
0x809cab4
0x809c167
0x82e62ac
0x830fc3a
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/mysql/en/Using_stack_trace.html
and follow instructions on how to resolve the stack trace. Resolved
stack trace is much more helpful in diagnosing the problem, so please do
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd-query at 0x892fe10 = SELECT id, short_iso_code, name, long_iso_code
FROM   country
WHERE  id = '1'
thd-thread_id=3
The manual page at http://www.mysql.com/doc/en/Crashing.html contains
information that should help you find out what is causing the crash.

Number of processes running now: 0
050518 10:39:43  mysqld restarted



mysqlbug server details
--
Release:   mysql-4.1.12-standard (MySQL Community Edition - Standard (GPL))
Server: /usr/bin/mysqladmin  Ver 8.41 Distrib 4.1.12, for pc-linux-gnu on i686
Copyright (C) 2000 MySQL AB  MySQL Finland AB  TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version  4.1.12-standard-log
Protocol version10
Connection  Localhost via UNIX socket
UNIX socket /var/lib/mysql/mysql.sock
Uptime: 1 min 44 sec

Threads: 1  Questions: 2  Slow queries: 0  Opens: 11  Flush tables: 1 
Open tables: 0  Queries per second avg: 0.019
C compiler:2.95.3
C++ compiler:  2.95.3
Environment:
machine, os, target, libraries (multiple lines)
System: Linux boothferry.cyki.com 2.6.8.1-24mdk #1 Fri Jan 14 03:01:00
MST 2005 i686 AMD Athlon(tm) XP 2800+ unknown GNU/Linux
Architecture: i686

Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1/specs
Configured with: ../configure --prefix=/usr --libdir=/usr/lib
--with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --disable-checking
--enable-long-long --enable-__cxa_atexit --enable-clocale=gnu
--disable-libunwind-exceptions
--enable-languages=c,c++,ada,f77,objc,java
--host=i586-mandrake-linux-gnu --with-system-zlib
Thread model: posix
gcc version 3.4.1 (Mandrakelinux 10.1 3.4.1-4mdk)
Compilation info: CC='gcc'  CFLAGS='-O2 -mcpu=i486
-fno-strength-reduce'  CXX='gcc'  CXXFLAGS='-O2 -mcpu=i486
-fno-strength-reduce-felide-constructors
-fno-exceptions -fno-rtti  '  LDFLAGS=''  ASFLAGS=''
LIBC:
lrwxrwxrwx  1 root root 13 Dec 31 07:36 /lib/libc.so.6 - libc-2.3.3.so
-rwxr-xr-x  1 root root 1119644 Dec 23 23:07 /lib/libc-2.3.3.so
-rw-r--r--  1 root root 204 Dec 23 22:55 /usr/lib/libc.so
Configure command: ./configure '--disable-shared'
'--with-mysqld-ldflags=-all-static'
'--with-client-ldflags=-all-static' '--with-comment=MySQL Community
Edition - Standard (GPL)' '--with-server-suffix=-standard'
'--without-embedded-server' '--without-berkeley-db' '--with-innodb'
'--without-vio' '--without-openssl' '--enable-assembler'
'--enable-local-infile' '--with-mysqld-user=mysql'
'--with-unix-socket-path=/var/lib/mysql/mysql.sock' '--prefix=/'
'--with-extra-charsets=complex' '--exec-prefix=/usr'
'--libexecdir=/usr/sbin' '--libdir=/usr/lib' 

RE: Export from Access

2005-05-18 Thread Partha Dutta
I think that the best approach would be to use the MySQL Migration Toolkit.
Why spend a lot of time writing a tool when something already exists, and it
works with Microsoft Access?

http://www.mysql.com/products/migration-toolkit/


--
Partha Dutta, Senior Consultant
MySQL Inc, NY, USA, www.mysql.com
 
Are you MySQL certified?  www.mysql.com/certification
 

 -Original Message-
 From: EP [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, May 18, 2005 2:02 AM
 To: Josh Trutwin; mysql@lists.mysql.com
 Subject: Re: Export from Access
 
 I recently exported a large Access database to MySQL using MyODBC.
 
 It took me a while to figure out that MyODBC was the thing to try, but
 once I did tried it, it only took me a few minutes to do the export.  I
 highly recommend that approach (MyODBC).
 
 -Eric
 
 
 
  Original Message
  From: Josh Trutwin [EMAIL PROTECTED]
  To: mysql@lists.mysql.com
  Date: Tue, May-17-2005 10:19 AM
  Subject: Re: Export from Access
 
  On Tue, 17 May 2005 17:17:31 +0100
  S.D.Price [EMAIL PROTECTED] wrote:
 
   Hi,
   can anyone explain how I would export a database created in Access
   to MySQL using PHPMyAdmin - I can't seem to import the data as csv
   or txt.
 
  Acess should allow exporting to CSV.  Otherwise you can skip
  phpMyAdmin and just use ODBC - check out MyODBC on mysql.com.
 
  Josh
 
  --
  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]



Re: 4.1.12 Crashing on Mandrake 10.1

2005-05-18 Thread Mark Hughes
On 5/18/05, Mark Hughes [EMAIL PROTECTED] wrote:
 Hi,
 
 I just upgraded from 4.1.11 (which worked fine, and stil does if I
 downgrade) to 4.1.12 and the first query crashes the server. This
 query is executed via DBD::mysql, when run via the mysql client it
 works OK though. I presume this must be some library conflict but has
 anyone got any idea what?
 

As a footnote to this the 4.1.12 build is significantly smaller, is
this expected?

15504128 MySQL-server-4.1.11-0.i386.rpm
12111588 MySQL-server-4.1.12-0.i386.rpm

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: mysql client update

2005-05-18 Thread Eric White
Hi All,

Thanks for the feedback!

On 5/17/05, David Logan [EMAIL PROTECTED] wrote:
 Philip Denno wrote:
 
 I'm no database expert, so I may be wrong but I do not think this
 functionality exists. Usually this type of notification is handled at
 the application level. That is build an application layer on top of the
 database which handles all reads and writes to the database. This layer
 would also keep track of all connected clients and would notify when a
 record is modified/inserted/created.
 
 Cheers,
 Philip.
 
 -Original Message-
 From: Eric White [mailto:[EMAIL PROTECTED]
 Sent: May 17, 2005 10:44 AM
 To: mysql@lists.mysql.com
 Subject: mysql client update
 
 
 Hi,
 
 Where should I look to find information about
 having clients notified when a table/record is
 updated?
 
 I have a situation where multiple clients will each
 have an open database connection, and I would
 like for them to be notified when the database is
 modified by a member of the group.
 
 Something like a trigger that informs all clients
 that a new record has been added for example.
 
 Thanks in advance.
 
 
 
 
 Regards
 
 Hi,
 
 Triggers were added at 5.0.2 They have some limitations but are
 documented in the manual at
 http://dev.mysql.com/doc/mysql/en/create-trigger.html
 
 Regards
 
 --
 
 David Logan
 South Australia
 
 when in trouble, or in doubt
 run in circles, scream and shout
 


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: varchar(10) to decimal

2005-05-18 Thread mfatene
Hi,
if varchar represents decimal(6,x) where x2, it's truncated. Else, it's
converted :


mysql create table dcml (a varchar(10));
Query OK, 0 rows affected (0.24 sec)

mysql insert into dcml values('16.00'),('16.25'),('16.125');
Query OK, 3 rows affected (0.05 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql select * from dcml;
++
| a  |
++
| 16.00  |
| 16.25  |
| 16.125 |
++
3 rows in set (0.03 sec)

mysql alter table dcml modify a decimal(6,2);
Query OK, 3 rows affected, 1 warning (0.24 sec)
Records: 3  Duplicates: 0  Warnings: 1

mysql show warnings;
+-+--++
| Level   | Code | Message|
+-+--++
| Warning | 1265 | Data truncated for column 'a' at row 3 |
+-+--++
1 row in set (0.00 sec)

mysql select * from dcml;
+---+
| a |
+---+
| 16.00 |
| 16.25 |
| 16.12 |
+---+
3 rows in set (0.00 sec)

Here, only row 3 is truncated !

Mathias



Selon Jerry Swanson [EMAIL PROTECTED]:

 decimal(6,2)

 On 5/18/05, Philippe Poelvoorde [EMAIL PROTECTED] wrote:
  Jerry Swanson wrote:
 
   I need to change format from varchar(10) to decimal.
   When I alter the table the data is trimmed.
  
   What I'm doing wrrong?
  
   TH
  
 
  ALTER TABLE your_table MODIFY your_column double NOT NULL DEFAULT '0.0';
  should normally work. What is the command you are doing and have you
  example results ?
  How did you declare your decimal column ?
 
  --
  Philippe Poelvoorde
  COS Trading Ltd.
 
  --
  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]



RE: varchar(10) to decimal

2005-05-18 Thread Gordon
I was all set to tell you why 16.125 became 16.12 when I ran the test on our
production box. It looks like some where between 4.0.20 and 5.0.4 the ALTER
TABLE to a decimal data type changed from truncation to rounding.

Redhat MySQL 4.0.20 truncates all 
Windows XP MySQL 5.0.4 Rounds with Windows algorithm 
I suspect a MySQL 5.0.4 on Linux would round with Linux alorithm but I don't
have one to test.

See following:

The decimal(6,2) tells MySQL to round all values to 2 places and store the
results in a decimal field. MySQL uses the Round routines of the host. 
On a Windows box 
16.125 = 16.13
16.135 = 16.14

On a Linux/Unix box
16.125 = 16.12
16.135 = 16.14

Here it is on windows

mysql select * from dcml;
++
| a  |
++
| 16.00  |
| 16.25  |
| 16.125 |
| 16.135 |
++
4 rows in set (0.00 sec)

mysql alter table dcml modify a decimal(6,2);
Query OK, 4 rows affected, 2 warnings (0.28 sec)
Records: 4  Duplicates: 0  Warnings: 2

mysql show warnings;
+---+--++
| Level | Code | Message|
+---+--++
| Note  | 1265 | Data truncated for column 'a' at row 3 |
| Note  | 1265 | Data truncated for column 'a' at row 4 |
+---+--++
2 rows in set (0.00 sec)

mysql select * from dcml;
+---+
| a |
+---+
| 16.00 |
| 16.25 |
| 16.13 |
| 16.14 |
+---+
4 rows in set (0.00 sec)

_

And on Linux
_

mysql create table dcml (a varchar(10));
Query OK, 0 rows affected (0.00 sec)

mysql insert into dcml values('16.00'),('16.25'),('16.125'),('16.135');
Query OK, 4 rows affected (0.01 sec)
Records: 4  Duplicates: 0  Warnings: 0

mysql select * from dcml;
++
| a  |
++
| 16.00  |
| 16.25  |
| 16.125 |
| 16.135 |
++
4 rows in set (0.00 sec)

mysql alter table dcml modify a decimal(6,2);
Query OK, 4 rows affected (0.00 sec)
Records: 4  Duplicates: 0  Warnings: 2

mysql show warnings;
ERROR 1064: You have an error in your SQL syntax.  Check the manual that
corre

Our production system is on 4.0.20 which does not support SHOW WARNINGS
and apparently the ALTER truncates always

mysql select * from dcml;
+---+
| a |
+---+
| 16.00 |
| 16.25 |
| 16.12 |
| 16.13 |
+---+
4 rows in set (0.00 sec)
_

Linux rule paraphrased: If the value to the right of the rounding column is
a 5 then if the rounding column is even round down if the rounding column is
odd round up.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 10:00 AM
To: Jerry Swanson
Cc: mysql@lists.mysql.com 
Subject: Re: varchar(10) to decimal

Hi,
if varchar represents decimal(6,x) where x2, it's truncated. Else, it's
converted :


mysql create table dcml (a varchar(10));
Query OK, 0 rows affected (0.24 sec)

mysql insert into dcml values('16.00'),('16.25'),('16.125'),('16.135');
Query OK, 3 rows affected (0.05 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql select * from dcml;
++
| a  |
++
| 16.00  |
| 16.25  |
| 16.125 |
++
3 rows in set (0.03 sec)

mysql alter table dcml modify a decimal(6,2);
Query OK, 3 rows affected, 1 warning (0.24 sec)
Records: 3  Duplicates: 0  Warnings: 1

mysql show warnings;
+-+--++
| Level   | Code | Message|
+-+--++
| Warning | 1265 | Data truncated for column 'a' at row 3 |
+-+--++
1 row in set (0.00 sec)

mysql select * from dcml;
+---+
| a |
+---+
| 16.00 |
| 16.25 |
| 16.12 |
+---+
3 rows in set (0.00 sec)

Here, only row 3 is truncated !

Mathias



Selon Jerry Swanson [EMAIL PROTECTED]:

 decimal(6,2)

 On 5/18/05, Philippe Poelvoorde [EMAIL PROTECTED] wrote:
  Jerry Swanson wrote:
 
   I need to change format from varchar(10) to decimal.
   When I alter the table the data is trimmed.
  
   What I'm doing wrrong?
  
   TH
  
 
  ALTER TABLE your_table MODIFY your_column double NOT NULL DEFAULT '0.0';
  should normally work. What is the command you are doing and have you
  example results ?
  How did you declare your decimal column ?
 
  --
  Philippe Poelvoorde
  COS Trading Ltd.
 
  --
  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 

Re: Export from Access

2005-05-18 Thread Alvaro Cobo
I've just seen the MySQL Migration Toolkit and looks very nice. Beautiful tool. 

On 5/17/05, S.D.Price [EMAIL PROTECTED] wrote:
 Hi,
 can anyone explain how I would export a database created in Access to
 MySQL using PHPMyAdmin - I can't seem to import the data as csv or txt.
 
 Thanks
 Steven
 
 

I've just seen the MySQL Migration Toolkit ans looks very nice.
Marvelous  tool.

Excelent advice from Partha Dutta!!!
-- 
Alvaro Cobo

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



CONCAT

2005-05-18 Thread Seena Blace
hi,
how to concat 2 columns to display in report?
 
select column1concat column2 form table1;
 
Concatenation Operator   pl?
thanks
 


-
Discover Yahoo!
 Stay in touch with email, IM, photo sharing  more. Check it out!

RE: CONCAT

2005-05-18 Thread Jay Blanchard
[snip]
how to concat 2 columns to display in report?
 
select column1concat column2 form table1;
 
Concatenation Operator   pl?
[/snip]

select concat('foo', 'bar') 
results foobar

select concat('foo', ' ', 'bar') 
results foo bar

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: QUERY (TOP)

2005-05-18 Thread Seena Blace
Thanks Shawn!

Peter Brawley [EMAIL PROTECTED] wrote:Seena,

That data is for one date. To test Shawn's 2-stage query I'd need a data for 
several days.

Without your tables and data, I tried Shawn's algorithm on a test database we 
use a lot, nwib, which is a MySQL port of the widely used (and copied) 
Microsoft Northwind database.  It has customers, orders, orderdetails, payments 
etc, and it's populated. Your question, 
  who are the top ten spammers per day?
is logically equivalent, in nwib, to: 
  what customers made the top ten number of orders for any given year?
Translating Shawn's method to nwib.orders gives us:

CREATE TABLE orderstats (
  yr SMALLINT NOT NULL ,
  rank INT AUTO_INCREMENT,
  customerID CHAR(5) NOT NULL,
  ordercount INT UNSIGNED NOT NULL,
  PRIMARY KEY(yr,rank)
);

INSERT orderstats 
  ( yr, customerID, ordercount )
  SELECT 
YEAR(orderdate) AS yr,
customerID,
COUNT(customerID) AS ordercount
  FROM orders
  GROUP BY yr, customerID
  ORDER BY yr,ordercount DESC

which, as Shawn says, auto-populates orderstats.rank for each group. After the 
above executes,
  SELECT * from orderstats WHERE rank = 10 
gives the top ten ordering customers per year, as expected.

So I am unclear why the algorithm does not work for your spam table.

PB

-

Seena Blace wrote: Peter 
here u go.just a few.You may see sample report.
 2005-05-05   | 1108529 | 0 |   
   1 |0 | 0 |
| 2005-05-05   | 1108529 | 0 |  
1 |0 | 0 |
| 2005-05-05   | 1108529 | 0 |  
1 |0 | 0 |
| 2005-05-05   | 1108529 | 0 |  
1 |0 | 0 |
| 2005-05-05   | 1108529 | 0 |  
1 |0 | 0 |
| 2005-05-05   | 1108529 | 0 |  
1 |0 | 0 |
| 2005-05-05   |   14140 | 0 |  
0 |0 | 0 |
| 2005-05-05   |  46 | 1 |  
0 |1 | 0 |
| 2005-05-05   |   10378 | 0 |  
0 |0 | 0 |
| 2005-05-05   |   16068 | 0 |  
0 |0 | 0 |
| 2005-05-05   |  110085 | 0 |  
1 |0 | 0

Peter Brawley [EMAIL PROTECTED] wrote:
Seena,

I'm curious how Shawn's elegant-looking solution fails. Would you mind sending 
me a small data sample so I can explore his solution? Thx.

Peter Brawley

-

Seena Blace wrote: 
Shawan,Here you go.mysql select * from spam_stats- where rank =10 
;+-+-+--+---+---+---+|
 report_date | report_sender_domain_id | rank | processed | spam  | suspected 
|+-+-+--+---+---+---+|
 2005-04-07  |  46 |1 | 22054 | 19263 |13 
|| 2005-04-06  |  46 |2 | 20229 | 16998 |37 
|| 2005-04-08  |  46 |3 | 19493 | 16443 |24 
|| 2005-04-05  |  46 |4 | 19322 | 15921 |   158 
|| 2005-04-29  |  46 |5 | 19241 | 15804 | 8 
|| 2005-05-02  |  46 |6 | 47732 | 15287 |82 
|| 2005-05-04  |  46 |7 | 91907 | 14275 |25 
|| 2005-04-29  |  52 |8 | 15875 | 13422 | 4 
|| 2005-05-02  |  52 |   
 9 | 56530 | 13098 |31 || 2005-05-04  |  52 |   
10 |129549 | 12566 |18 
|+-+-+--+---+---+---+10
 rows in set (0.00 sec)[EMAIL PROTECTED] wrote:Please try my solution before 
you tell me it's broken, OK? I know you want to see the top 10 spammers for 
EACH day. That's what I wrote for you. Please try my solution with your data 
and get back to me with the results and explain to me what's wrong so I can fix 
it.Thank you for your patience,Shawn GreenDatabase AdministratorUnimin 
Corporation - Spruce PineSeena Blace wrote on 05/16/2005 04:41:19 PM:  

Shawn,query SELECT * FROM spam_statsWHERE rank = 10;will return all rows which 
I don't want.I need datewise top 10 spam domain.means condition would be serach 
those rows which are having top 10 spam (means highest) on each day and show 
the output like which I send [EMAIL PROTECTED] wrote:Seena Blace wrote on 
05/16/2005 11:13:48 AM:

shawnI think 2nd query will return only 10 rows.I want out like followingsdate 
domain spam05/05/05 hotmail.com 12005/05/05 yahoo.com 11005/05/05 abc.com 
9905/05/05 def.com 

Different TIMESTAMP columns

2005-05-18 Thread Lieven De Keyzer
I 'm writing a webapplication in Java that allows users to store bookmarks. 
The system scans these pages for differences at user-selected intervals. At 
another user-selected interval, the system sends notification mails about 
changed bookmarks. The bookmark table provisionally looks like this:

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 TIMESTAMP NOT NULL,
 PRIMARY KEY (bookmark_id),
 FOREIGN KEY (folder_id) REFERENCES folder(folder_id) ON DELETE CASCADE) 
TYPE = InnoDB;

I want to add another TIMESTAMP column, last_notified. But whenever I insert 
a new bookmark, the first TIMESTAMP column will be set, the other will be 
-00-00 00:00:00.
When they get mapped by the iBatis framework to Java objects, I get an 
exception that aTimestamp object can not be created with -00-00 00:00:0

Is there a way I can set them both when the bookmark is created? I rather 
not set one of them to NULL, because that would imply a lot more code to 
check if a user should be notified or a bookmark should be scanned.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Different TIMESTAMP columns

2005-05-18 Thread mfatene
Hi,
look at default initialised to current_timestamp. you ca see also on update :

http://dev.mysql.com/doc/mysql/en/timestamp-4-1.html

Mathias

Selon Lieven De Keyzer [EMAIL PROTECTED]:

 I 'm writing a webapplication in Java that allows users to store bookmarks.
 The system scans these pages for differences at user-selected intervals. At
 another user-selected interval, the system sends notification mails about
 changed bookmarks. The bookmark table provisionally looks like this:

 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 TIMESTAMP NOT NULL,
   PRIMARY KEY (bookmark_id),
   FOREIGN KEY (folder_id) REFERENCES folder(folder_id) ON DELETE CASCADE)
 TYPE = InnoDB;

 I want to add another TIMESTAMP column, last_notified. But whenever I insert
 a new bookmark, the first TIMESTAMP column will be set, the other will be
 -00-00 00:00:00.
 When they get mapped by the iBatis framework to Java objects, I get an
 exception that aTimestamp object can not be created with -00-00 00:00:0

 Is there a way I can set them both when the bookmark is created? I rather
 not set one of them to NULL, because that would imply a lot more code to
 check if a user should be notified or a bookmark should be scanned.



 --
 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]



Restoring a database from binlogs

2005-05-18 Thread Jeff McKeon
Hey all,

I've got a big problem.  Seems one of our programmers decided to write a
script that deletes all records from a log table older than 3 months.
Problem is, we need old data from this log to reconcile our customer
accounts.  

Our backups only go back 2 weeks.  What I do have however is replication
running and therefore old binlogs.  These binlogs go back as far as Nov
12, 2004.  The cleaning of the log table didn't start until about a
month ago and has deleted any data prior to Jan 18, 2005.  

The only snapshot I can find of the database is from Sept 10, 2004.  

So.. (shooting off into the dark) I have binlogs starting from Nov 12, a
snapshot from sept 10th.  Is there some way anyone can suggest that I
can reconstruct the database table with what I have?

Best Reguards,

Jeff


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: varchar(10) to decimal

2005-05-18 Thread Michael Stassen
4.1.11 truncates as well, and not just for ALTER TABLE.  My tests show 
mysql handles input to a DECIMAL(M,D) column inconsistently: It rounds 
if the input is numeric, but it truncates if the input is a string.  I'm 
guessing that because mysql 4.x stores DECIMALs as strings, it handles 
the string case with a simple string copy, hence the truncation.  I 
think that's a bug, so I reported it as such 
http://bugs.mysql.com/10719.  We'll see what the developers think.

The different behavior in 5.0.4 is no doubt a result of the change made 
to DECIMAL in 5.0.3, 
http://dev.mysql.com/doc/mysql/en/precision-math-decimal-changes.html, 
though this particular aspect of the change doesn't seem to be 
documented.  Starting with 5.0.3, DECIMAL is no longer a string, so I'd 
bet the input string is converted to a number first, which means it gets 
rounded before it is assigned, as is the case in mysql 4.x

Michael
Gordon wrote:
I was all set to tell you why 16.125 became 16.12 when I ran the test on our
production box. It looks like some where between 4.0.20 and 5.0.4 the ALTER
TABLE to a decimal data type changed from truncation to rounding.
Redhat MySQL 4.0.20 truncates all 
Windows XP MySQL 5.0.4 Rounds with Windows algorithm 
I suspect a MySQL 5.0.4 on Linux would round with Linux alorithm but I don't
have one to test.

See following:
The decimal(6,2) tells MySQL to round all values to 2 places and store the
results in a decimal field. MySQL uses the Round routines of the host. 
On a Windows box 
	16.125 = 16.13
	16.135 = 16.14

On a Linux/Unix box
16.125 = 16.12
16.135 = 16.14
Here it is on windows

mysql select * from dcml;
++
| a  |
++
| 16.00  |
| 16.25  |
| 16.125 |
| 16.135 |
++
4 rows in set (0.00 sec)
mysql alter table dcml modify a decimal(6,2);
Query OK, 4 rows affected, 2 warnings (0.28 sec)
Records: 4  Duplicates: 0  Warnings: 2
mysql show warnings;
+---+--++
| Level | Code | Message|
+---+--++
| Note  | 1265 | Data truncated for column 'a' at row 3 |
| Note  | 1265 | Data truncated for column 'a' at row 4 |
+---+--++
2 rows in set (0.00 sec)
mysql select * from dcml;
+---+
| a |
+---+
| 16.00 |
| 16.25 |
| 16.13 |
| 16.14 |
+---+
4 rows in set (0.00 sec)
_
And on Linux
_
mysql create table dcml (a varchar(10));
Query OK, 0 rows affected (0.00 sec)
mysql insert into dcml values('16.00'),('16.25'),('16.125'),('16.135');
Query OK, 4 rows affected (0.01 sec)
Records: 4  Duplicates: 0  Warnings: 0
mysql select * from dcml;
++
| a  |
++
| 16.00  |
| 16.25  |
| 16.125 |
| 16.135 |
++
4 rows in set (0.00 sec)
mysql alter table dcml modify a decimal(6,2);
Query OK, 4 rows affected (0.00 sec)
Records: 4  Duplicates: 0  Warnings: 2
mysql show warnings;
ERROR 1064: You have an error in your SQL syntax.  Check the manual that
corre
Our production system is on 4.0.20 which does not support SHOW WARNINGS
and apparently the ALTER truncates always
mysql select * from dcml;
+---+
| a |
+---+
| 16.00 |
| 16.25 |
| 16.12 |
| 16.13 |
+---+
4 rows in set (0.00 sec)
_
Linux rule paraphrased: If the value to the right of the rounding column is
a 5 then if the rounding column is even round down if the rounding column is
odd round up.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 10:00 AM
To: Jerry Swanson
Cc: mysql@lists.mysql.com 
Subject: Re: varchar(10) to decimal

Hi,
if varchar represents decimal(6,x) where x2, it's truncated. Else, it's
converted :
mysql create table dcml (a varchar(10));
Query OK, 0 rows affected (0.24 sec)
mysql insert into dcml values('16.00'),('16.25'),('16.125'),('16.135');
Query OK, 3 rows affected (0.05 sec)
Records: 3  Duplicates: 0  Warnings: 0
mysql select * from dcml;
++
| a  |
++
| 16.00  |
| 16.25  |
| 16.125 |
++
3 rows in set (0.03 sec)
mysql alter table dcml modify a decimal(6,2);
Query OK, 3 rows affected, 1 warning (0.24 sec)
Records: 3  Duplicates: 0  Warnings: 1
mysql show warnings;
+-+--++
| Level   | Code | Message|
+-+--++
| Warning | 1265 | Data truncated for column 'a' at row 3 |
+-+--++
1 row in set (0.00 sec)
mysql select * from dcml;
+---+
| a |
+---+
| 16.00 |
| 16.25 |
| 16.12 |
+---+
3 rows in set (0.00 sec)
Here, only 

Re: Different TIMESTAMP columns

2005-05-18 Thread Lieven De Keyzer
Yes, that's what I'm talking about. Only one column can have this 
current_timestamp as default statement.

From: [EMAIL PROTECTED]
To: Lieven De Keyzer [EMAIL PROTECTED]
CC: mysql@lists.mysql.com
Subject: Re: Different TIMESTAMP columns
Date: Wed, 18 May 2005 19:57:43 +0200
Hi,
look at default initialised to current_timestamp. you ca see also on update 
:

http://dev.mysql.com/doc/mysql/en/timestamp-4-1.html
Mathias
Selon Lieven De Keyzer [EMAIL PROTECTED]:
 I 'm writing a webapplication in Java that allows users to store 
bookmarks.
 The system scans these pages for differences at user-selected intervals. 
At
 another user-selected interval, the system sends notification mails 
about
 changed bookmarks. The bookmark table provisionally looks like this:

 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 TIMESTAMP NOT NULL,
   PRIMARY KEY (bookmark_id),
   FOREIGN KEY (folder_id) REFERENCES folder(folder_id) ON DELETE 
CASCADE)
 TYPE = InnoDB;

 I want to add another TIMESTAMP column, last_notified. But whenever I 
insert
 a new bookmark, the first TIMESTAMP column will be set, the other will 
be
 -00-00 00:00:00.
 When they get mapped by the iBatis framework to Java objects, I get an
 exception that aTimestamp object can not be created with -00-00 
00:00:0

 Is there a way I can set them both when the bookmark is created? I 
rather
 not set one of them to NULL, because that would imply a lot more code to
 check if a user should be notified or a bookmark should be scanned.



 --
 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: Restoring a database from binlogs

2005-05-18 Thread Dathan Pattishall
Dump the binarylogs into a text file greping all the log data in order
of oldest to newest (minus the massive delete). Then reply the events
backinto mysql


Mysqlbinlog binlogs in order |grep [your tablename]  BIGSQLFILE.sql

mysql -uroot database  BIGSQLFILE.sql


DVP

Dathan Vance Pattishall http://www.friendster.com

 

 -Original Message-
 From: Jeff McKeon [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, May 18, 2005 11:31 AM
 To: mysql@lists.mysql.com
 Subject: Restoring a database from binlogs
 
 Hey all,
 
 I've got a big problem.  Seems one of our programmers decided 
 to write a script that deletes all records from a log table 
 older than 3 months.
 Problem is, we need old data from this log to reconcile our 
 customer accounts.  
 
 Our backups only go back 2 weeks.  What I do have however is 
 replication running and therefore old binlogs.  These binlogs 
 go back as far as Nov 12, 2004.  The cleaning of the log 
 table didn't start until about a month ago and has deleted 
 any data prior to Jan 18, 2005.  
 
 The only snapshot I can find of the database is from Sept 10, 2004.  
 
 So.. (shooting off into the dark) I have binlogs starting 
 from Nov 12, a snapshot from sept 10th.  Is there some way 
 anyone can suggest that I can reconstruct the database table 
 with what I have?
 
 Best Reguards,
 
 Jeff
 
 
 --
 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: Different TIMESTAMP columns

2005-05-18 Thread SGreen
Lieven De Keyzer [EMAIL PROTECTED] wrote on 05/18/2005 
01:44:31 PM:

 I 'm writing a webapplication in Java that allows users to store 
bookmarks. 
 The system scans these pages for differences at user-selected intervals. 
At 
 another user-selected interval, the system sends notification mails 
about 
 changed bookmarks. The bookmark table provisionally looks like this:
 
 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 TIMESTAMP NOT NULL,
   PRIMARY KEY (bookmark_id),
   FOREIGN KEY (folder_id) REFERENCES folder(folder_id) ON DELETE 
CASCADE) 
 TYPE = InnoDB;
 
 I want to add another TIMESTAMP column, last_notified. But whenever I 
insert 
 a new bookmark, the first TIMESTAMP column will be set, the other will 
be 
 -00-00 00:00:00.
 When they get mapped by the iBatis framework to Java objects, I get an 
 exception that aTimestamp object can not be created with -00-00 
00:00:0
 
 Is there a way I can set them both when the bookmark is created? I 
rather 
 not set one of them to NULL, because that would imply a lot more code to 

 check if a user should be notified or a bookmark should be scanned.
 
 
In MySQL, timestamp columns are somewhat special. That is why they are not 
normally used to store manually updated values. To store a date+time value 
and not have it overwritten with the time and date of the next update to 
the record, you should use a DATETIME column.

The exact behavior of timestamp columns depends on if they are the only 
one on a table and which version of MySQL you are running. Please refer to 
http://dev.mysql.com/doc/mysql/en/datetime.html for more details.

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine


Re: Different TIMESTAMP columns

2005-05-18 Thread Lieven De Keyzer

From: [EMAIL PROTECTED]
To: Lieven De Keyzer [EMAIL PROTECTED]
CC: mysql@lists.mysql.com
Subject: Re: Different TIMESTAMP columns
Date: Wed, 18 May 2005 15:05:17 -0400
Lieven De Keyzer [EMAIL PROTECTED] wrote on 05/18/2005
01:44:31 PM:
 I 'm writing a webapplication in Java that allows users to store
bookmarks.
 The system scans these pages for differences at user-selected intervals.
At
 another user-selected interval, the system sends notification mails
about
 changed bookmarks. The bookmark table provisionally looks like this:

 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 TIMESTAMP NOT NULL,
   PRIMARY KEY (bookmark_id),
   FOREIGN KEY (folder_id) REFERENCES folder(folder_id) ON DELETE
CASCADE)
 TYPE = InnoDB;

 I want to add another TIMESTAMP column, last_notified. But whenever I
insert
 a new bookmark, the first TIMESTAMP column will be set, the other will
be
 -00-00 00:00:00.
 When they get mapped by the iBatis framework to Java objects, I get an
 exception that aTimestamp object can not be created with -00-00
00:00:0

 Is there a way I can set them both when the bookmark is created? I
rather
 not set one of them to NULL, because that would imply a lot more code to
 check if a user should be notified or a bookmark should be scanned.


In MySQL, timestamp columns are somewhat special. That is why they are not
normally used to store manually updated values. To store a date+time value
and not have it overwritten with the time and date of the next update to
the record, you should use a DATETIME column.
The exact behavior of timestamp columns depends on if they are the only
one on a table and which version of MySQL you are running. Please refer to
http://dev.mysql.com/doc/mysql/en/datetime.html for more details.
Yes, I have already considered using the DATETIME, but there is no Java 
class for this database type?

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: Restoring a database from binlogs

2005-05-18 Thread Jeff McKeon
Interesting idea.  

So if I take the table from Sept 10th and then do that with the binlog
I'll be missing about 2 months worth of data because my earliest binlog
file is Nov 12th.

The queries are always one to a line in the binlog?

Best Reguards,

Jeff 

 -Original Message-
 From: Dathan Pattishall [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, May 18, 2005 2:16 PM
 To: Jeff McKeon; mysql@lists.mysql.com
 Subject: RE: Restoring a database from binlogs
 
 
 Dump the binarylogs into a text file greping all the log data 
 in order of oldest to newest (minus the massive delete). Then 
 reply the events backinto mysql
 
 
 Mysqlbinlog binlogs in order |grep [your tablename]  BIGSQLFILE.sql
 
 mysql -uroot database  BIGSQLFILE.sql
 
 
 DVP
 
 Dathan Vance Pattishall http://www.friendster.com
 
  
 
  -Original Message-
  From: Jeff McKeon [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, May 18, 2005 11:31 AM
  To: mysql@lists.mysql.com
  Subject: Restoring a database from binlogs
  
  Hey all,
  
  I've got a big problem.  Seems one of our programmers decided
  to write a script that deletes all records from a log table 
  older than 3 months.
  Problem is, we need old data from this log to reconcile our 
  customer accounts.  
  
  Our backups only go back 2 weeks.  What I do have however is
  replication running and therefore old binlogs.  These binlogs 
  go back as far as Nov 12, 2004.  The cleaning of the log 
  table didn't start until about a month ago and has deleted 
  any data prior to Jan 18, 2005.  
  
  The only snapshot I can find of the database is from Sept 10, 2004.
  
  So.. (shooting off into the dark) I have binlogs starting
  from Nov 12, a snapshot from sept 10th.  Is there some way 
  anyone can suggest that I can reconstruct the database table 
  with what I have?
  
  Best Reguards,
  
  Jeff
  
  
  --
  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: Different TIMESTAMP columns

2005-05-18 Thread SGreen
Lieven De Keyzer [EMAIL PROTECTED] wrote on 05/18/2005 
03:21:02 PM:

 
 
 From: [EMAIL PROTECTED]
 To: Lieven De Keyzer [EMAIL PROTECTED]
 CC: mysql@lists.mysql.com
 Subject: Re: Different TIMESTAMP columns
 Date: Wed, 18 May 2005 15:05:17 -0400
 
 Lieven De Keyzer [EMAIL PROTECTED] wrote on 05/18/2005
 01:44:31 PM:
 
   I 'm writing a webapplication in Java that allows users to store
 bookmarks.
   The system scans these pages for differences at user-selected 
intervals.
 At
   another user-selected interval, the system sends notification mails
 about
   changed bookmarks. The bookmark table provisionally looks like this:
  
   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 TIMESTAMP NOT NULL,
 PRIMARY KEY (bookmark_id),
 FOREIGN KEY (folder_id) REFERENCES folder(folder_id) ON DELETE
 CASCADE)
   TYPE = InnoDB;
  
   I want to add another TIMESTAMP column, last_notified. But whenever 
I
 insert
   a new bookmark, the first TIMESTAMP column will be set, the other 
will
 be
   -00-00 00:00:00.
   When they get mapped by the iBatis framework to Java objects, I get 
an
   exception that aTimestamp object can not be created with -00-00
 00:00:0
  
   Is there a way I can set them both when the bookmark is created? I
 rather
   not set one of them to NULL, because that would imply a lot more 
code to
 
   check if a user should be notified or a bookmark should be scanned.
  
  
 In MySQL, timestamp columns are somewhat special. That is why they are 
not
 normally used to store manually updated values. To store a date+time 
value
 and not have it overwritten with the time and date of the next update 
to
 the record, you should use a DATETIME column.
 
 The exact behavior of timestamp columns depends on if they are the only
 one on a table and which version of MySQL you are running. Please refer 
to
 http://dev.mysql.com/doc/mysql/en/datetime.html for more details.
 
 Yes, I have already considered using the DATETIME, but there is no Java 
 class for this database type?
 
 
 Shawn Green
 Database Administrator
 Unimin Corporation - Spruce Pine
 

I am not sure which Java package you are using (or I would look at its 
documentation to make sure of what I am about to say) but it makes sense 
to me that an object of the Java timestamp class would map to a MySQL 
datetime field. What happens when you try that kind of match?

You see, the name timestamp cannot not mean exactly the same thing under 
all circumstances or across different languages. This may be the case 
where what Java calls timestamp, MySQL calls datetime. Same data, 
different name.

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine



Re: Restoring a database from binlogs

2005-05-18 Thread kernel
Jeff McKeon wrote:
Hey all,
I've got a big problem.  Seems one of our programmers decided to write a
script that deletes all records from a log table older than 3 months.
Problem is, we need old data from this log to reconcile our customer
accounts.  

Our backups only go back 2 weeks.  What I do have however is replication
running and therefore old binlogs.  These binlogs go back as far as Nov
12, 2004.  The cleaning of the log table didn't start until about a
month ago and has deleted any data prior to Jan 18, 2005.  

The only snapshot I can find of the database is from Sept 10, 2004.  

So.. (shooting off into the dark) I have binlogs starting from Nov 12, a
snapshot from sept 10th.  Is there some way anyone can suggest that I
can reconstruct the database table with what I have?
Best Reguards,
Jeff
 

Jeff,
The data between the snap shot and when the logging started is  gone. 
Since you do have the binlogs, extract them to text files and write a 
perl script to figure out what insert/update statements you need.  I've 
done it before and it took some time to make sure I grabbed the correct 
update/insert statements. As a side note, it might be worth the $$$ to 
setup a replication server that you can take off-line to do cold 
backups. When you make the backups, you know exactly what time and what 
logfile and posistion it was at. The replication server in most cases 
doesn't need near the processing power the primary db does. Good luck !

walt
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Different TIMESTAMP columns

2005-05-18 Thread Mark Matthews
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[EMAIL PROTECTED] wrote:
 Lieven De Keyzer [EMAIL PROTECTED] wrote on 05/18/2005 
 03:21:02 PM:
[snip]

Yes, I have already considered using the DATETIME, but there is no Java 
class for this database type?


Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

 
 I am not sure which Java package you are using (or I would look at its 
 documentation to make sure of what I am about to say) but it makes sense 
 to me that an object of the Java timestamp class would map to a MySQL 
 datetime field. What happens when you try that kind of match?
 
 You see, the name timestamp cannot not mean exactly the same thing under 
 all circumstances or across different languages. This may be the case 
 where what Java calls timestamp, MySQL calls datetime. Same data, 
 different name.

Shawn,

You are correct. The MySQL JDBC drivers maps MySQL's DATETIME to
java.sql.Timestamp.

Lieven, you might've found this section in the documentation for the
JDBC driver helpful:

http://dev.mysql.com/doc/connector/j/en/cj-type-conversions.html#id2785196

-Mark


- --
Mark Matthews
MySQL AB, Software Development Manager - Connectivity
www.mysql.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCi55wtvXNTca6JD8RAq6oAJ4xCIvt5SqpXnzf/Ye9T2fEk8XczACeLlhD
T3wG44j2xM3hu9OBY0tf8Ak=
=RKz+
-END PGP SIGNATURE-

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



not a rpm package?

2005-05-18 Thread Bing Du
I downloaded MySQL-server-5.0.4-0.i386.rpm.  When I did 'rpm -i
MySQL-server-5.0.4-0.i386.rpm', the following message returned:

MySQL-server-5.0.4-0.i386.rpm: not an rpm package (or package manifest):

What's the problem?

Bing

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Replication with failover

2005-05-18 Thread Kevin Burton
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...

Kevin
--
Use Rojo (RSS/Atom aggregator)! - visit http://rojo.com. 
See irc.freenode.net #rojo if you want to chat.

Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html
  Kevin A. Burton, Location - San Francisco, CA
 AIM/YIM - sfburtonator,  Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412 

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


remote connection problem

2005-05-18 Thread Andy McHargue
I'm having trouble connecting remotely from Server A (local) to Server B 
(remote).  Both Linux.

From Server A, I'm issuing this command
mysql -h [domain.com] -u [user] -p
And I get
ERROR 2003: Can't connect to MySQL server on 'domain.com' (110)
I assume this is a time out.
1. The user on Server B is set up with all privileges.
2. Server B's my.cnf has the line bind-address=127.0.0.1 but it is 
commented out with #
3. Server B's skip_networking is OFF.
4.  A netstat -tl on Server B gives the line
tcp0  0 domain.com:3306   *:* LISTEN

I notice that on a different server, I get this
tcp0  0 *:mysql 
*:* LISTEN

and there's no line containing 3306.
What's with that?
5.  for troubleshooting's sake, ssh [remote-ip] -p 3306 times out.  
telnet is unavailable.



Re: Different TIMESTAMP columns

2005-05-18 Thread Lieven De Keyzer

From: Mark Matthews [EMAIL PROTECTED]
To: Lieven De Keyzer [EMAIL PROTECTED]
CC: [EMAIL PROTECTED], mysql@lists.mysql.com
Subject: Re: Different TIMESTAMP columns
Date: Wed, 18 May 2005 14:58:41 -0500
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
[EMAIL PROTECTED] wrote:
 Lieven De Keyzer [EMAIL PROTECTED] wrote on 05/18/2005
 03:21:02 PM:
[snip]
Yes, I have already considered using the DATETIME, but there is no Java
class for this database type?


Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine


 I am not sure which Java package you are using (or I would look at its
 documentation to make sure of what I am about to say) but it makes sense
 to me that an object of the Java timestamp class would map to a MySQL
 datetime field. What happens when you try that kind of match?

 You see, the name timestamp cannot not mean exactly the same thing 
under
 all circumstances or across different languages. This may be the case
 where what Java calls timestamp, MySQL calls datetime. Same data,
 different name.

Shawn,
You are correct. The MySQL JDBC drivers maps MySQL's DATETIME to
java.sql.Timestamp.
Lieven, you might've found this section in the documentation for the
JDBC driver helpful:
http://dev.mysql.com/doc/connector/j/en/cj-type-conversions.html#id2785196
	-Mark
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


- --
Mark Matthews
MySQL AB, Software Development Manager - Connectivity
www.mysql.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCi55wtvXNTca6JD8RAq6oAJ4xCIvt5SqpXnzf/Ye9T2fEk8XczACeLlhD
T3wG44j2xM3hu9OBY0tf8Ak=
=RKz+
-END PGP SIGNATURE-
--
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]


access 3.23 tables on 5.0?

2005-05-18 Thread Bing Du
We moved a bunch of *.frm, *.MYD and *.MYI from 5.0 to 3.23.  Now after
successfully connecting to 3.23, it shows:

Didn't find any fields in table 'person'
Didn't find any fields in table '...'


mysql desc person;
ERROR 1033: Incorrect information in file: './LTM/person.frm'

Is there anyway to make these tables created on 5.0 to be accessible on 3.23?

Thanks in advance for any help.

Bing

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



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...

Kevin
That would be nice, because I googled and searched the list archives and 
found nothing.

-Simon
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


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.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Different TIMESTAMP columns

2005-05-18 Thread Lieven De Keyzer
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 DEFAULT NOW(),
   -   PRIMARY KEY (bookmark_id),
   -   FOREIGN KEY (folder_id) REFERENCES folder(folder_id) ON DELETE 
CASCADE) TYPE = InnoDB;

ERROR 1067 (42000): Invalid default value for 'last_scanned'
From: Simon Garner [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Subject: Re: Different TIMESTAMP columns
Date: Thu, 19 May 2005 09:52:02 +1200
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.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: 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 DEFAULT NOW(),
   -   PRIMARY KEY (bookmark_id),
   -   FOREIGN KEY (folder_id) REFERENCES folder(folder_id) ON DELETE 
CASCADE) TYPE = InnoDB;

No, not their default - you have to set the value when you insert or 
update the row. The default can only be a particular date, not a dynamic 
value.

e.g.
UPDATE bookmark SET last_scanned=NOW()
-Simon
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Restoring mySQL dump

2005-05-18 Thread Adrian Cooper
Hello,
I need to restore a mySQL dump file but cannot find the right syntax.
I have root access and have used:
mysql -u root -p account_databasename  backupname
But I am getting: Access denied for user '[EMAIL PROTECTED]' (Using password: 
YES)

I have also removed the root password and got: Access denied for user 
'[EMAIL PROTECTED]' (Using password: No)

What is the correct syntax please?
Also, can I create a new database and restore the dump file to it or do I 
need to use the same database name as before?

Thank you very much indeed.
Best regards.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Restoring mySQL dump

2005-05-18 Thread Dwayne Hottinger
That is correct.  The password for mysql root is probably not the same as the
system root.

ddh


Quoting Adrian Cooper [EMAIL PROTECTED]:

 Hello,

 I need to restore a mySQL dump file but cannot find the right syntax.

 I have root access and have used:

 mysql -u root -p account_databasename  backupname

 But I am getting: Access denied for user '[EMAIL PROTECTED]' (Using password:
 YES)

 I have also removed the root password and got: Access denied for user
 '[EMAIL PROTECTED]' (Using password: No)

 What is the correct syntax please?

 Also, can I create a new database and restore the dump file to it or do I
 need to use the same database name as before?

 Thank you very much indeed.

 Best regards.


 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:
 http://lists.mysql.com/[EMAIL PROTECTED]



--
Dwayne Hottinger
Network Administrator
Harrisonburg City Public Schools

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Restoring mySQL dump

2005-05-18 Thread Schalk Neethling
Can you sign -in as root user i.e. Administrator? Using:
mysql -u username -p password?
Dwayne Hottinger wrote:
That is correct.  The password for mysql root is probably not the same as the
system root.
ddh
Quoting Adrian Cooper [EMAIL PROTECTED]:
 

Hello,
I need to restore a mySQL dump file but cannot find the right syntax.
I have root access and have used:
mysql -u root -p account_databasename  backupname
But I am getting: Access denied for user '[EMAIL PROTECTED]' (Using password:
YES)
I have also removed the root password and got: Access denied for user
'[EMAIL PROTECTED]' (Using password: No)
What is the correct syntax please?
Also, can I create a new database and restore the dump file to it or do I
need to use the same database name as before?
Thank you very much indeed.
Best regards.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]
   


--
Dwayne Hottinger
Network Administrator
Harrisonburg City Public Schools
 

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers
emotionalize.conceptualize.visualize.realize
Landlines
Tel: +27125468436
Fax: +27125468436
Web
email:[EMAIL PROTECTED]
Global: www.volume4.com
Messenger
Yahoo!: v_olume4
AOL: v0lume4
MSN: [EMAIL PROTECTED]
We support OpenSource
Get Firefox!- The browser reloaded - http://www.mozilla.org/products/firefox/
This message contains information that is considered to be sensitive or 
confidential and may not be forwarded or disclosed to any other party without 
the permission of the sender. If you received this message in error, please 
notify me immediately so that I can correct and delete the original email. 
Thank you.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: remote connection problem

2005-05-18 Thread Andy McHargue
Here's some more data on this, if anyone can help.
--I can connect the other way around ... i.e. I can connect from B to 
A.  So there's no general connectivity problem.
--did an nmap on B,
$ nmap -sT -T Polite -p3306 xx.com

Starting nmap V. 2.54BETA22 ( www.insecure.org/nmap/ )
Interesting ports on s191.n33.xx.com (66.84.xx.xx):
Port   State   Service
3306/tcp   filteredmysql
nmap on B indicates 'open' rather than 'filtered' ... how can i change?
Andy McHargue wrote:
I'm having trouble connecting remotely from Server A (local) to Server 
B (remote).  Both Linux.

From Server A, I'm issuing this command
mysql -h [domain.com] -u [user] -p
And I get
ERROR 2003: Can't connect to MySQL server on 'domain.com' (110)
I assume this is a time out.
1. The user on Server B is set up with all privileges.
2. Server B's my.cnf has the line bind-address=127.0.0.1 but it is 
commented out with #
3. Server B's skip_networking is OFF.
4.  A netstat -tl on Server B gives the line
tcp0  0 domain.com:3306   *:* LISTEN

I notice that on a different server, I get this
tcp0  0 *:mysql 
*:* LISTEN

and there's no line containing 3306.
What's with that?
5.  for troubleshooting's sake, ssh [remote-ip] -p 3306 times out.  
telnet is unavailable.


--
Andy McHargue
Webmaster
Annenberg School for Communication
University of Southern California
http://annenberg.usc.edu
[EMAIL PROTECTED]
Phone: 213.740.1290

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Using AVG

2005-05-18 Thread Mike Blezien
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
--
Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


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
SELECT (5+8+10)/3 AS rate;
is what you want?
-Simon
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Using AVG

2005-05-18 Thread Mike Blezien
Simon Garner wrote:
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
SELECT (5+8+10)/3 AS rate;
is what you want?
-Simon
Exactly, my mistake... too long of a day. got my logic mixed up :)
thx's
--
Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Using AVG

2005-05-18 Thread Dominicus Donny
Try this:
SELECT AVG((5+8+10)/3) AS rate FROM an_existing_table_name;
- Original Message - 
From: Mike Blezien [EMAIL PROTECTED]
To: MySQL List mysql@lists.mysql.com
Sent: Thursday, May 19, 2005 9:24 AM
Subject: Using AVG


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
--
Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Restoring mySQL dump

2005-05-18 Thread Karam Chand
Since I am on Windows, I prefer to use a GUI tool like
SQLyog (www.webyog.com)

Karam

--- Adrian Cooper [EMAIL PROTECTED] wrote:
 Hello,
 
 I need to restore a mySQL dump file but cannot find
 the right syntax.
 
 I have root access and have used:
 
 mysql -u root -p account_databasename  backupname
 
 But I am getting: Access denied for user
 '[EMAIL PROTECTED]' (Using password: 
 YES)
 
 I have also removed the root password and got:
 Access denied for user 
 '[EMAIL PROTECTED]' (Using password: No)
 
 What is the correct syntax please?
 
 Also, can I create a new database and restore the
 dump file to it or do I 
 need to use the same database name as before?
 
 Thank you very much indeed.
 
 Best regards.
 
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:   

http://lists.mysql.com/[EMAIL PROTECTED]
 
 



Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Export from Access

2005-05-18 Thread Karam Chand
If you are on Windows then you can directly import
data using SQLyog's ODBC Import Tool.

www.webyog.com

Regards,
Karam

--- S.D.Price [EMAIL PROTECTED] wrote:
 Hi,
 can anyone explain how I would export a database
 created in Access to
 MySQL using PHPMyAdmin - I can't seem to import the
 data as csv or txt.
 
 Thanks
 Steven 
 
 
 



Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Lost connection to Mysql server during query using a group by clause and sub query

2005-05-18 Thread Dan Rossi
Hi there, I am having issues with this funny error message. I am trying 
to do a sub query and then a group by clause on a date. However i keep 
getting this annoying message for some reason. Happens via terminal 
aswell as my sql gui.  Here is the query I am trying to do

select (select count(discrepancy_originID) FROM report_log WHERE 
discrepancy_originID=1) as total FROM report_log GROUP BY MONTH 
(tx_date)

let me know, if i take the sub query out its ok ?
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]