Re: creating temp file, modifying data and putting into other table

2008-01-18 Thread Jochem van Dieten
On Jan 17, 2008 9:02 PM, Kerry Frater wrote:
 Thanks for the input Jochem.

If you wish to ignore my code and continue with your own code that of
course is fine with me. But why do you expect me to continue to help
you if you ignore me anyway?

Jochem

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



Re: MySql at 100% CPU

2008-01-18 Thread Ben Clewett

No worries :)

 Good luck with your problem!

Apparently not, since no member of the MySql team wants to tell me and 
this mailing list what scenario's will cause a low-load MySql system 
lock at 100% CPU for hours on end.


Another of my servers has just entered this mode about half an hour ago. 
 I include the xload graph just to show I am not imagining this!


Another guess: these servers are quite new and growing at several gig a 
week.  Does InnoDB have some mode whereby it checks all tables after 
some threshold of time, size or row count?  Which is likely to take 
hours and put the CPU load at 100%?


If four of my ten MySql servers are doing this regularly, I can't be the 
only person with this problem.  Can somebody from MySql please let me 
know that on earth you are doing to my CPU's??


Regards,

Ben

BTW, who controls InnoDB?  Is it Oracle or Sun?


Kevin Hunter wrote:

At 12:08p -0500 on 17 Jan 2008, Ben Clewett wrote:
The package you show gives the same output as the 'SHOW PROCESSLIST' 
output, which I included in my previous email :)


Heh, that'll teach me to actually /use/ the package before recommending 
it. :-P  (I just found out about it when that article came out, and 
haven't yet had a chance to try it out.)


Good luck with your problem!

Kevin




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

Who know this strange problem

2008-01-18 Thread Moon's Father
My test is as follows:
mysql  select g_id from t group by g_id order by g_id desc limit 0,1;
+--+
| g_id |
+--+
|6 |
+--+
1 row in set (0.00 sec)

mysql  select g_id from t group by g_id order by g_id desc limit 0,1 into
@tmp_id;
Query OK, 1 row affected (0.00 sec)

mysql select @tmp_id;
+-+
| @tmp_id |
+-+
|   5 |
+-+
1 row in set (0.00 sec)

mysql select version();
+-+
| version()   |
+-+
| 5.1.21-beta-log |
+-+
1 row in set (0.00 sec)

mysql


But the variabe @tmp_id 's value is 5;
Any help is appreciated.

Here is my test data.

DROP TABLE IF EXISTS `t`;

CREATE TABLE `t` (
  `id` int(11) NOT NULL auto_increment,
  `g_id` int(11) NOT NULL,
  `t_str` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`),
  key (`g_id`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8;

/*Data for the table `t` */

insert  into `t`(`id`,`g_id`,`t_str`) values
(1,2,'wo'),
(2,2,'ni'),
(3,2,'ta'),
(4,3,'wo '),
(5,4,'ni'),
(6,3,'ni'),
(7,4,'ta'),
(8,3,'wang'),
(9,4,'li'),
(10,3,'hai'),
(11,4,'ri'),
(12,2,'ren'),
(13,5,'ta'),
(14,6,'ri'),
(15,6,'ren'),
(16,6,'fuck'),
(17,6,'shit'),
(18,5,'ls'),
(19,5,'chmod'),
(20,5,'chgrp'),
(21,5,'chown'),
(22,3,'rm'),
(23,3,'desc'),
(24,4,'pwd'),
(25,5,'cd');


-- 
I'm a mysql DBA in china.
More about me just visit here:
http://yueliangdao0608.cublog.cn


Re: select

2008-01-18 Thread Hiep Nguyen

On Fri, 18 Jan 2008, Sebastian Mendel wrote:


Hiep Nguyen schrieb:

hi all,

i have a table looks like this:

ID sDate
1  1997-03-21
2  1997-04-30
3  1997-05-30
4  1998-01-29
5  1998-02-24
6  1998-03-21
7  1999-05-10
8  1999-07-12
9  1999-10-20
10 2000-01-01
11 2000-02-15
12 2000-03-20
13 2000-05-18


how do i construct my select statement so that i only get distinct year? so 
the above data will return something like this:


sDate
2000
1999
1998
1997


did your tried:

SELECT DISTINCT YEAR(`sDate`);


--
Sebastian


thanks, that's perfect.
t. hiep

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



upgrading mysql on RHEL4

2008-01-18 Thread perl pra
Hi Gurus,

I have mysql4.x installed on REHL4.

Can anybody let me know how to upgrade it to 5.1.

Also please tell me where can i get mysql5.1 enterprise edition.

Thanks in advance
Siva


basic style shema question

2008-01-18 Thread Alex K
Hi Guys,

Let's suppose I have the following table:

create table companies
(
id  int(11) not null auto_increment primary key,

# user's login and password
email   varchar(100),
passwordvarchar(100),

# basic information
company_namevarchar(100),
contact_namevarchar(100),
street  varchar(100),
cityvarchar(100),
state   varchar(7),
zip varchar(13),
phone   varchar(25),

# user's company description
description text,
category_other  text,

# localization
desired_zip varchar(7),
latitudedec(10,7),
longitude   dec(10,7),

# user's personalized options
url varchar(200) not null unique,
logo_md5varchar(32),
linked_url  varchar(200),
color_bgrd  varchar(16),

# content moderation (null if nothing, 1 for new, 2 for updates)
updates smallint,
banned  boolean
);

Would you keep this as one table or would you split it into multiple
tables such as users, company localizations, personalized options and
moderation which would hold each the fields under each comment
together with a company_id? The first way of doing it is easier to
update because I would not have to update all the other linked tables.
But the other way of doing seems cleaner.

To summarize one table vs. many tables with one to one relations?

Thank you,

Alex

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



Re: basic style shema question

2008-01-18 Thread Saravanan
Hi,

Split frequently used columns from other non frequently used. Splitting them 
will improve the disk access. You don't need to separate as too many tables. 
You need to index all the tables if you split into many.

Saravanan


--- On Fri, 1/18/08, Alex K [EMAIL PROTECTED] wrote:

 From: Alex K [EMAIL PROTECTED]
 Subject: basic style shema question
 To: mysql@lists.mysql.com
 Date: Friday, January 18, 2008, 11:14 PM
 Hi Guys,
 
 Let's suppose I have the following table:
 
 create table companies
 (
 id  int(11) not null auto_increment primary
 key,
 
 # user's login and password
 email   varchar(100),
 passwordvarchar(100),
 
 # basic information
 company_namevarchar(100),
 contact_namevarchar(100),
 street  varchar(100),
 cityvarchar(100),
 state   varchar(7),
 zip varchar(13),
 phone   varchar(25),
 
 # user's company description
 description text,
 category_other  text,
 
 # localization
 desired_zip varchar(7),
 latitudedec(10,7),
 longitude   dec(10,7),
 
 # user's personalized options
 url varchar(200) not null unique,
 logo_md5varchar(32),
 linked_url  varchar(200),
 color_bgrd  varchar(16),
 
 # content moderation (null if nothing, 1 for new, 2 for
 updates)
 updates smallint,
 banned  boolean
 );
 
 Would you keep this as one table or would you split it into
 multiple
 tables such as users, company localizations, personalized
 options and
 moderation which would hold each the fields under each
 comment
 together with a company_id? The first way of doing it is
 easier to
 update because I would not have to update all the other
 linked tables.
 But the other way of doing seems cleaner.
 
 To summarize one table vs. many tables with one to one
 relations?
 
 Thank you,
 
 Alex
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:   
 http://lists.mysql.com/[EMAIL PROTECTED]


  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

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



Latest Development Over Nepal and World

2008-01-18 Thread Nepalnews

hamropalo.com/biz/box.php?funcml=unsub2nl=1[EMAIL PROTECTED]

--
To Unsubscribe, please click here:
hamropalo.com/biz//box.php?funcml=unsub2nl=1[EMAIL PROTECTED]

Re: generating numbers from other fields

2008-01-18 Thread Sebastian Mendel

Brian E Boothe schrieb:
how can i join three fields Values into one field? so in three select 
boxes i have date :
Projects type 1 - 7   and project type 1 - 6   so the third Filed would 
be 116200824 generated by the other three fields?


please clarify!

or did you mean CONCAT() or CONCAT_WS() or as operator: |

--
Sebastian

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



Re: Storing Larger MySQL Backups

2008-01-18 Thread Tom Brown





I'm curious if anyone has any thoughts on how I can handle a data 
retention issue I've been facing with a larger dataset.


My process, roughtly is run mysqldump against the DB and gzip the 
output. Then I transfer it off to a different machine for archival 
onto optical media (yes I know there's a shelf of the media life 
involved there). This is a secondary backup to the backup I'm doing 
for system recovery purposes - not the only method of backup, but I 
don't have access to that storage system as it's provided via the ISP. 
Recently the file has gotten so big it doesn't fit on a standard DVD-R 
media any longer. I've considered only backing up key data, but for 
the archive it's much more convenient to have the entire structure 
intact in one location - additionally, we occasionally build a test 
machine from this data so it's integrity is moderately important. 
Ideally, I'd like to be able to script the compression and slicing 
right on the server that does the backup, but I realize this may not 
be possible.


I'm looking at using RAR to archive the output file and slice it into 
smaller segments so I can distribute the data over 2 DVD-R (or 
multiple CD-R's if so desired.)


Does anyone have any feedback on this approach? Without laying out 
money for a higher capacity DVD/BlueRay drive or tape backup system, 
what options are you using for data retention?



have a look at the split command so that the output goes into more than 
1 file


eg

mysqldump -e -u user -ppassword databasename | split -b 1024m


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



Re: basic style shema question

2008-01-18 Thread Kevin Hunter

At 11:44a -0500 on 18 Jan 2008, Alex K wrote:

To summarize one table vs. many tables with one to one relations?


As per usual, it depends on your needs.  For most flexibility, and to 
give the DB the best chance to give the best plan for the possible 
requests I might make in the future, I generally tend towards 
normalization, not denormalization.


The question is: what do you want to do with the schema?

Kevin

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



Re: upgrading mysql on RHEL4

2008-01-18 Thread Saravanan

Hi,

Take backup of the existing data before upgrading for safety. There is RHEL 4 
specific  rpm binary is existing in the downloading section. After installing 
run the required tools comes with mysql.


Before upgrading with existing datas read the documentation carefully.

http://dev.mysql.com/doc/refman/5.1/en/installing.html

Saravanan

--- On Fri, 1/18/08, perl pra [EMAIL PROTECTED] wrote:

 From: perl pra [EMAIL PROTECTED]
 Subject: upgrading mysql on RHEL4
 To: mysql@lists.mysql.com
 Date: Friday, January 18, 2008, 10:21 PM
 Hi Gurus,
 
 I have mysql4.x installed on REHL4.
 
 Can anybody let me know how to upgrade it to 5.1.
 
 Also please tell me where can i get mysql5.1 enterprise
 edition.
 
 Thanks in advance
 Siva


  

Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

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



RE: creating temp file, modifying data and putting into other table

2008-01-18 Thread Saravanan
Hi,

Are you using mysql browser? If yes. It will run only the current line 
statement. It will not execute all the three statements. So try one after the 
other.

Saravanan


--- On Fri, 1/18/08, Kerry Frater [EMAIL PROTECTED] wrote:

 From: Kerry Frater [EMAIL PROTECTED]
 Subject: RE: creating temp file, modifying data and putting into other table
 To: 'Sebastian Mendel' [EMAIL PROTECTED], 'MySql' 
 mysql@lists.mysql.com
 Date: Friday, January 18, 2008, 9:33 PM
 I have just tried it with lowercase with the same result.
 
 To test I have opened up the query browser and typed 3
 lines
 
 create temporary table ttable1 (select * from testnames
 where ref='ABCDE');
 update ttable1 set ref='12345678';
 select * from ttable1;
 
 I leave the cursor on the 3rd line and click on execute. I
 get the result
 
 Testdb.ttable1 doesn't exist error 1146
 
 If I leave the cursor on the first line then it appears to
 execute the first
 line as I do not get an error but no data is shown.
 
 Does the browser run a script? Is that why I am getting
 problems and I
 should be testing in another way?
 
 Kerry
 
 -Original Message-
 From: Sebastian Mendel [mailto:[EMAIL PROTECTED] 
 Sent: 18 January 2008 13:24
 To: [EMAIL PROTECTED]; 'MySql'
 Subject: Re: creating temp file, modifying data and putting
 into other table
 
 Kerry Frater schrieb:
  Can someone please advise. I am looking to create a
 multiuser friendly
 way
  of getting a subset number of rows from a table into
 another whilst making
 a
  modification.
  
  I thought that this could be done using a temporary
 table in a batch
 script
  that is unique to that session e.g.
  
  create temporary table Ttable1 (select * from
 masterlist where
 ref='ABCDE');
  update Ttable1 set ref='SMI0C001';
  insert into sublist select * from Ttable1;
  drop Ttable1;
  
  I know the above syntax doesn't work but it shows
 the steps I am looking
 to
  take. 
  
  Hope this makes enough sense to be able to answer.
 
 did you tried with lowercase table names (ttable1) too?
 
 -- 
 Sebastian
 
 
 -- 
 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]


  

Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

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



Re: select

2008-01-18 Thread Sebastian Mendel

Hiep Nguyen schrieb:

hi all,

i have a table looks like this:

ID sDate
1  1997-03-21
2  1997-04-30
3  1997-05-30
4  1998-01-29
5  1998-02-24
6  1998-03-21
7  1999-05-10
8  1999-07-12
9  1999-10-20
10 2000-01-01
11 2000-02-15
12 2000-03-20
13 2000-05-18


how do i construct my select statement so that i only get distinct year? 
so the above data will return something like this:


sDate
2000
1999
1998
1997


did your tried:

SELECT DISTINCT YEAR(`sDate`);


--
Sebastian

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



Re: basic style shema question

2008-01-18 Thread Saravanan
Hi,

Split frequently used columns from other non frequently used. Splitting them 
will improve the disk access. You don't need to separate as too many tables. 
You need to index all the tables if you split into many.

Saravanan



--- On Fri, 1/18/08, Alex K [EMAIL PROTECTED] wrote:

 From: Alex K [EMAIL PROTECTED]
 Subject: basic style shema question
 To: mysql@lists.mysql.com
 Date: Friday, January 18, 2008, 11:14 PM
 Hi Guys,
 
 Let's suppose I have the following table:
 
 create table companies
 (
 id  int(11) not null auto_increment primary
 key,
 
 # user's login and password
 email   varchar(100),
 passwordvarchar(100),
 
 # basic information
 company_namevarchar(100),
 contact_namevarchar(100),
 street  varchar(100),
 cityvarchar(100),
 state   varchar(7),
 zip varchar(13),
 phone   varchar(25),
 
 # user's company description
 description text,
 category_other  text,
 
 # localization
 desired_zip varchar(7),
 latitudedec(10,7),
 longitude   dec(10,7),
 
 # user's personalized options
 url varchar(200) not null unique,
 logo_md5varchar(32),
 linked_url  varchar(200),
 color_bgrd  varchar(16),
 
 # content moderation (null if nothing, 1 for new, 2 for
 updates)
 updates smallint,
 banned  boolean
 );
 
 Would you keep this as one table or would you split it into
 multiple
 tables such as users, company localizations, personalized
 options and
 moderation which would hold each the fields under each
 comment
 together with a company_id? The first way of doing it is
 easier to
 update because I would not have to update all the other
 linked tables.
 But the other way of doing seems cleaner.
 
 To summarize one table vs. many tables with one to one
 relations?
 
 Thank you,
 
 Alex
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:   
 http://lists.mysql.com/[EMAIL PROTECTED]


  

Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

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



Re: turn a slave back into its own master

2008-01-18 Thread Paul Berry
thanks - i think i'm ok because
i get these results
mysql show slave status;
Empty set (0.00 sec)



On 1/18/08, Saravanan [EMAIL PROTECTED] wrote:

 Hi,

 will removing the master.info help instead of executing change master?

 or
 stop slave;
 reset master;


 --- On Sat, 1/19/08, Paul Berry [EMAIL PROTECTED] wrote:

  From: Paul Berry [EMAIL PROTECTED]
  Subject: Re: turn a slave back into its own master
  To: MySql mysql@lists.mysql.com
  Date: Saturday, January 19, 2008, 5:31 AM
  i ended up doing this - it seems to have worked fine
 
  STOP SLAVE;
  SHOW SLAVE STATUS;
  CHANGE MASTER TO
MASTER_HOST='',
MASTER_PORT=0,
MASTER_USER='',
MASTER_PASSWORD='';
  RESET MASTER;
 
 
 
  On 1/18/08, Paul Berry [EMAIL PROTECTED]
  wrote:
  
   hi guys, quick question
  
   how do i undo a CHANGE MASTER TO command and make it a
  master of itself
   again?
   thanks 
  



   
 
 Never miss a thing.  Make Yahoo your home page.
 http://www.yahoo.com/r/hs



Re: turn a slave back into its own master

2008-01-18 Thread B. Keith Murphy
I believe you would have been ok with stop slave and reset master. 


Saravanan wrote:

i am ok with this

mysql change master to master_host='';
Query OK, 0 rows affected (0.01 sec)

mysql show slave status\G
Empty set (0.01 sec)

Saravanan


--- On Sat, 1/19/08, Paul Berry [EMAIL PROTECTED] wrote:

  

From: Paul Berry [EMAIL PROTECTED]
Subject: Re: turn a slave back into its own master
To: [EMAIL PROTECTED]
Cc: MySql mysql@lists.mysql.com
Date: Saturday, January 19, 2008, 6:03 AM
thanks - i think i'm ok because
i get these results
mysql show slave status;
Empty set (0.00 sec)



On 1/18/08, Saravanan [EMAIL PROTECTED] wrote:


Hi,

will removing the master.info help instead of
  

executing change master?


or
  

stop slave;
reset master;


--- On Sat, 1/19/08, Paul Berry
  

[EMAIL PROTECTED] wrote:


From: Paul Berry [EMAIL PROTECTED]
Subject: Re: turn a slave back into its own


master


To: MySql


mysql@lists.mysql.com


Date: Saturday, January 19, 2008, 5:31 AM
i ended up doing this - it seems to have worked


fine


STOP SLAVE;
SHOW SLAVE STATUS;
CHANGE MASTER TO
  MASTER_HOST='',
  MASTER_PORT=0,
  MASTER_USER='',
  MASTER_PASSWORD='';
RESET MASTER;



On 1/18/08, Paul Berry


[EMAIL PROTECTED]


wrote:


hi guys, quick question

how do i undo a CHANGE MASTER TO command and
  

make it a


master of itself


again?
thanks 

  


 
  




Never miss a thing.  Make Yahoo your home page.
http://www.yahoo.com/r/hs

  



  

Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping


  



--
B. Keith Murphy

Paragon Consulting Services
http://www.paragon-cs.com
850-637-3877


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



Re: another slave loading question

2008-01-18 Thread Saravanan
did you check time in master and slave servers? 

saravanan


--- On Sat, 1/19/08, Paul Berry [EMAIL PROTECTED] wrote:

 From: Paul Berry [EMAIL PROTECTED]
 Subject: another slave loading question
 To: MySql mysql@lists.mysql.com
 Date: Saturday, January 19, 2008, 7:56 AM
 i have this State when I start a slave: Has read all relay
 log; waiting for
 the slave I/O thread to update it
 
 mysql show processlist;
 ++-+---+---+-+--+---+--+
 | Id | User| Host  | db| Command | Time |
 State  
   |
 Info |
 ++-+---+---+-+--+---+--+
 | 17 | root| localhost |  | Query   |0 |
 NULL   
   | show
 processlist |
 | 23 | system user |   | NULL  | Connect |2057
 | Has read all
 relay log; waiting for the slave I/O thread to update it |
 NULL
 |
 ++-+---+---+-+--+---+--+
 2 rows in set (0.00 sec)
 
 
 it was started with a mysqldump and is now many hours
 behind the master
 it seems from what i've researched that its now off on
 the start points and
 so it won't ever get through it
 can i  LOAD DATA FROM MASTER; to have it clean up, or is
 there a method or
 something i'm missing
 thanks!
 paul


  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

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



Re: turn a slave back into its own master

2008-01-18 Thread Saravanan
Hi,

will removing the master.info help instead of executing change master?

or
stop slave;
reset master;


--- On Sat, 1/19/08, Paul Berry [EMAIL PROTECTED] wrote:

 From: Paul Berry [EMAIL PROTECTED]
 Subject: Re: turn a slave back into its own master
 To: MySql mysql@lists.mysql.com
 Date: Saturday, January 19, 2008, 5:31 AM
 i ended up doing this - it seems to have worked fine
 
 STOP SLAVE;
 SHOW SLAVE STATUS;
 CHANGE MASTER TO
   MASTER_HOST='',
   MASTER_PORT=0,
   MASTER_USER='',
   MASTER_PASSWORD='';
 RESET MASTER;
 
 
 
 On 1/18/08, Paul Berry [EMAIL PROTECTED]
 wrote:
 
  hi guys, quick question
 
  how do i undo a CHANGE MASTER TO command and make it a
 master of itself
  again?
  thanks 
 


  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

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



Re: Select statement help

2008-01-18 Thread Baron Schwartz
Hi,

On Jan 18, 2008 2:59 PM, RoryGRen [EMAIL PROTECTED] wrote:

 Hi all

 I am quite new to mySQL and have the following question I hope someone can
 help me with:

 I have a database table imported directly from MS Access with two of the
 field names having brackets - F(1) and S(1). I don't want to change the
 field names, as I am simply going to import again when the database needs
 updating.

 How can I select these fields from the table? - SELECT F(1), S(1) doesn't
 work, SELECT F(1) , S(1) doesn't work and neither does SELECT [F(1)],
 [S(1)]

Quote the names with backticks: `F(1)`, `S(1)`

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



Select statement help

2008-01-18 Thread RoryGRen

Hi all

I am quite new to mySQL and have the following question I hope someone can
help me with:

I have a database table imported directly from MS Access with two of the
field names having brackets - F(1) and S(1). I don't want to change the
field names, as I am simply going to import again when the database needs
updating.

How can I select these fields from the table? - SELECT F(1), S(1) doesn't
work, SELECT F(1) , S(1) doesn't work and neither does SELECT [F(1)],
[S(1)]

Thanks, in anticipation!

Rory
-- 
View this message in context: 
http://www.nabble.com/Select-statement-help-tp14957781p14957781.html
Sent from the MySQL - General mailing list archive at Nabble.com.


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



Re: Handling Special Characters

2008-01-18 Thread Baron Schwartz
Jerry,

On Jan 18, 2008 2:27 PM, Jerry Schwartz [EMAIL PROTECTED] wrote:
 I am having trouble inserting special characters into a table. I am using
 the MySQL client. I put the following commands into a text file (I'm on
 WinXP, using Notepad), copy them, and paste them into the MySQL command line
 client.

 SET NAMES utf8;

 CREATE TEMPORARY TABLE `giiexpr_db`.`eo_name_table` (
 `eo_name` VARCHAR( 255 ) NOT NULL
 ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;

 INSERT INTO eo_name_table
 (eo_name)
 VALUES
 (Associated British Foods Plc (Abf) - Hot Drinks - World);

 SELECT * FROM eo_name_table;
 +-+
 | eo_name |
 +-+
 | Associated British Foods Plc (Abf) - Hot Drinks - World |
 +-+
 1 row in set (0.04 sec)

 That symbol before World is an N-dash, 0x96. This works perfectly.

 Here's where things go wrong. If instead of pasting these commands into the
 client, I source the exact same file, I get this:

 +-+
 | eo_name |
 +-+
 | Associated British Foods Plc (Abf) - Hot Drinks |
 +-+
 1 row in set (0.04 sec)

 It seems that special characters are treated differently when they are in a
 sourced file. It isn't just the N-dash, French accented characters cause the
 same problem. These are all single-byte characters.

 Just to be sure, I checked the length of the string in the field, and it
 accurately reflected the difference. That proves, to my satisfaction, that
 the problem is on the input side.

 I'm using version 4.1.22 community server on a Linux platform. I'm using
 version 5.0.45 of the CLI client.

 Anyone have any ideas? I was trying to avoid having to write a program to do
 this.

After you get the data you want into the table via copy/paste, can you
dump and reload it correctly with mysqldump  dump.sql and mysql 
dump.sql?  If so, try peeking into the dump file and see how it's
written there.

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



RE: creating temp file, modifying data and putting into other table

2008-01-18 Thread Kerry Frater
Yes it is the mysql browser. I have tried one after the other with the same
result.

So it looks as though I am using the wrong testbed

Kerrry

-Original Message-
From: Saravanan [mailto:[EMAIL PROTECTED] 
Sent: 18 January 2008 15:12
To: 'Sebastian Mendel'; 'MySql'; [EMAIL PROTECTED]
Subject: RE: creating temp file, modifying data and putting into other table

Hi,

Are you using mysql browser? If yes. It will run only the current line
statement. It will not execute all the three statements. So try one after
the other.

Saravanan


--- On Fri, 1/18/08, Kerry Frater [EMAIL PROTECTED] wrote:

 From: Kerry Frater [EMAIL PROTECTED]
 Subject: RE: creating temp file, modifying data and putting into other
table
 To: 'Sebastian Mendel' [EMAIL PROTECTED], 'MySql'
mysql@lists.mysql.com
 Date: Friday, January 18, 2008, 9:33 PM
 I have just tried it with lowercase with the same result.
 
 To test I have opened up the query browser and typed 3
 lines
 
 create temporary table ttable1 (select * from testnames
 where ref='ABCDE');
 update ttable1 set ref='12345678';
 select * from ttable1;
 
 I leave the cursor on the 3rd line and click on execute. I
 get the result
 
 Testdb.ttable1 doesn't exist error 1146
 
 If I leave the cursor on the first line then it appears to
 execute the first
 line as I do not get an error but no data is shown.
 
 Does the browser run a script? Is that why I am getting
 problems and I
 should be testing in another way?
 
 Kerry
 
 -Original Message-
 From: Sebastian Mendel [mailto:[EMAIL PROTECTED] 
 Sent: 18 January 2008 13:24
 To: [EMAIL PROTECTED]; 'MySql'
 Subject: Re: creating temp file, modifying data and putting
 into other table
 
 Kerry Frater schrieb:
  Can someone please advise. I am looking to create a
 multiuser friendly
 way
  of getting a subset number of rows from a table into
 another whilst making
 a
  modification.
  
  I thought that this could be done using a temporary
 table in a batch
 script
  that is unique to that session e.g.
  
  create temporary table Ttable1 (select * from
 masterlist where
 ref='ABCDE');
  update Ttable1 set ref='SMI0C001';
  insert into sublist select * from Ttable1;
  drop Ttable1;
  
  I know the above syntax doesn't work but it shows
 the steps I am looking
 to
  take. 
  
  Hope this makes enough sense to be able to answer.
 
 did you tried with lowercase table names (ttable1) too?
 
 -- 
 Sebastian
 
 
 -- 
 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]


 


Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

-- 
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: creating temp file, modifying data and putting into other table

2008-01-18 Thread Kerry Frater
I have just tried it with lowercase with the same result.

To test I have opened up the query browser and typed 3 lines

create temporary table ttable1 (select * from testnames where ref='ABCDE');
update ttable1 set ref='12345678';
select * from ttable1;

I leave the cursor on the 3rd line and click on execute. I get the result

Testdb.ttable1 doesn't exist error 1146

If I leave the cursor on the first line then it appears to execute the first
line as I do not get an error but no data is shown.

Does the browser run a script? Is that why I am getting problems and I
should be testing in another way?

Kerry

-Original Message-
From: Sebastian Mendel [mailto:[EMAIL PROTECTED] 
Sent: 18 January 2008 13:24
To: [EMAIL PROTECTED]; 'MySql'
Subject: Re: creating temp file, modifying data and putting into other table

Kerry Frater schrieb:
 Can someone please advise. I am looking to create a multiuser friendly
way
 of getting a subset number of rows from a table into another whilst making
a
 modification.
 
 I thought that this could be done using a temporary table in a batch
script
 that is unique to that session e.g.
 
 create temporary table Ttable1 (select * from masterlist where
ref='ABCDE');
 update Ttable1 set ref='SMI0C001';
 insert into sublist select * from Ttable1;
 drop Ttable1;
 
 I know the above syntax doesn't work but it shows the steps I am looking
to
 take. 
 
 Hope this makes enough sense to be able to answer.

did you tried with lowercase table names (ttable1) too?

-- 
Sebastian


-- 
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: another slave loading question

2008-01-18 Thread Paul Berry
hi thanks for the quick answer ! these 2 servers are in different timezones
- do i need to set the slave server to the master slave's timezone?

i'm giong to research implementing that right away - in the meantime i
thought this might help show some information

i have this on the master:

mysql show master status;
++--+--+--+
| File   | Position | Binlog_Do_DB | Binlog_Ignore_DB |
++--+--+--+
| dp3-bin.02 |  5382028 | * |  |
++--+--+--+
1 row in set (0.00 sec)


and this on the slave:

mysql show slave status;
++--+-+-+---+-+-++---+---+--+---+-+-+++-+-+++--+-+-+-++---++++-+---++---+
| Slave_IO_State | Master_Host  | Master_User | Master_Port | Connect_Retry
| Master_Log_File | Read_Master_Log_Pos | Relay_Log_File |
Relay_Log_Pos | Relay_Master_Log_File | Slave_IO_Running | Slave_SQL_Running
| Replicate_Do_DB | Replicate_Ignore_DB | Replicate_Do_Table |
Replicate_Ignore_Table | Replicate_Wild_Do_Table |
Replicate_Wild_Ignore_Table | Last_Errno | Last_Error | Skip_Counter |
Exec_Master_Log_Pos | Relay_Log_Space | Until_Condition | Until_Log_File |
Until_Log_Pos | Master_SSL_Allowed | Master_SSL_CA_File | Master_SSL_CA_Path
| Master_SSL_Cert | Master_SSL_Cipher | Master_SSL_Key |
Seconds_Behind_Master |
++--+-+-+---+-+-++---+---+--+---+-+-+++-+-+++--+-+-+-++---++++-+---++---+
|| *   | * |   13306 |60 |
dp3-bin.02  | 4126670 | *-sql-relay-bin.02|
   233 |
dp3-bin.02| No   | Yes   | *
;  | |
||
| |  0 ||0
| 4126670 | 233 | None|
| 0 | No |
|| |   |
|   |
++--+-+-+---+-+-++---+---+--+---+-+-+++-+-+++--+-+-+-++---++++-+---++---+
1 row in set (0.00 sec)





On 1/18/08, Saravanan [EMAIL PROTECTED] wrote:

 did you check time in master and slave servers?

 saravanan


 --- On Sat, 1/19/08, Paul Berry [EMAIL PROTECTED] wrote:

  From: Paul Berry [EMAIL PROTECTED]
  Subject: another slave loading question
  To: MySql mysql@lists.mysql.com
  Date: Saturday, January 19, 2008, 7:56 AM
  i have this State when I start a slave: Has read all relay
  log; waiting for
  the slave I/O thread to update it
 
  mysql show processlist;
 
 ++-+---+---+-+--+---+--+
  | Id | User| Host  | db| Command | Time |
  State
|
  Info |
 
 ++-+---+---+-+--+---+--+
  | 17 | root| localhost |  | Query   |0 |
  NULL
| show
  processlist |
  | 23 | system user |   | NULL  | Connect |2057
  | Has read all
  relay log; waiting for the slave I/O thread to update it |
  NULL
  |
 
 

Re: creating temp file, modifying data and putting into other table

2008-01-18 Thread Martin Gainty
the default DB is mysql
to verify execute mysql client and then show the databases

mysql show databases;
++
| Database   |
++
| information_schema |
| catalog|
| mysql  |
| petclinic  |
| test   |
++
5 rows in set (0.02 sec)

now if I want to create a ttable in the test DB first I must connect to the
DB e.g.
mysql connect test;
Connection id:21
Current database: test

now ALL SQL Statements such as creates/inserts/updates/deletes/selects will
work using the test DB
(you must do the same for Testdb Database)

HTH
M-
- Original Message -
From: Kerry Frater [EMAIL PROTECTED]
To: 'Sebastian Mendel' [EMAIL PROTECTED]; 'MySql'
mysql@lists.mysql.com
Sent: Friday, January 18, 2008 10:03 AM
Subject: RE: creating temp file, modifying data and putting into other table


 I have just tried it with lowercase with the same result.

 To test I have opened up the query browser and typed 3 lines

 create temporary table ttable1 (select * from testnames where
ref='ABCDE');
 update ttable1 set ref='12345678';
 select * from ttable1;

 I leave the cursor on the 3rd line and click on execute. I get the result

 Testdb.ttable1 doesn't exist error 1146

 If I leave the cursor on the first line then it appears to execute the
first
 line as I do not get an error but no data is shown.

 Does the browser run a script? Is that why I am getting problems and I
 should be testing in another way?

 Kerry

 -Original Message-
 From: Sebastian Mendel [mailto:[EMAIL PROTECTED]
 Sent: 18 January 2008 13:24
 To: [EMAIL PROTECTED]; 'MySql'
 Subject: Re: creating temp file, modifying data and putting into other
table

 Kerry Frater schrieb:
  Can someone please advise. I am looking to create a multiuser friendly
 way
  of getting a subset number of rows from a table into another whilst
making
 a
  modification.
 
  I thought that this could be done using a temporary table in a batch
 script
  that is unique to that session e.g.
 
  create temporary table Ttable1 (select * from masterlist where
 ref='ABCDE');
  update Ttable1 set ref='SMI0C001';
  insert into sublist select * from Ttable1;
  drop Ttable1;
 
  I know the above syntax doesn't work but it shows the steps I am looking
 to
  take.
 
  Hope this makes enough sense to be able to answer.

 did you tried with lowercase table names (ttable1) too?

 --
 Sebastian


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



turn a slave back into its own master

2008-01-18 Thread Paul Berry
hi guys, quick question

how do i undo a CHANGE MASTER TO command and make it a master of itself
again?
thanks 


Handling Special Characters

2008-01-18 Thread Jerry Schwartz
I am having trouble inserting special characters into a table. I am using
the MySQL client. I put the following commands into a text file (I'm on
WinXP, using Notepad), copy them, and paste them into the MySQL command line
client.

SET NAMES utf8;

CREATE TEMPORARY TABLE `giiexpr_db`.`eo_name_table` (
`eo_name` VARCHAR( 255 ) NOT NULL
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;

INSERT INTO eo_name_table
(eo_name)
VALUES
(Associated British Foods Plc (Abf) - Hot Drinks - World);

SELECT * FROM eo_name_table;
+-+
| eo_name |
+-+
| Associated British Foods Plc (Abf) - Hot Drinks - World |
+-+
1 row in set (0.04 sec)

That symbol before World is an N-dash, 0x96. This works perfectly.

Here's where things go wrong. If instead of pasting these commands into the
client, I source the exact same file, I get this:

+-+
| eo_name |
+-+
| Associated British Foods Plc (Abf) - Hot Drinks |
+-+
1 row in set (0.04 sec)

It seems that special characters are treated differently when they are in a
sourced file. It isn't just the N-dash, French accented characters cause the
same problem. These are all single-byte characters.

Just to be sure, I checked the length of the string in the field, and it
accurately reflected the difference. That proves, to my satisfaction, that
the problem is on the input side.

I'm using version 4.1.22 community server on a Linux platform. I'm using
version 5.0.45 of the CLI client.

Anyone have any ideas? I was trying to avoid having to write a program to do
this.

Regards,

Jerry Schwartz
The Infoshop by Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341

www.the-infoshop.com
www.giiexpress.com
www.etudes-marche.com




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



Re: basic style shema question

2008-01-18 Thread Kevin Hunter
Hmm.  If we're talking pure DB theory, then the whole point is to apply 
the DRY principle as much as possible.  At the point you have multiple 
copies of the same data, unless your programmers are perfect (and they 
aren't, I promise), you *will* have stale data.  Better to have only one 
place to update things.


Some other questions/thoughts that come to mind:
- Will it ever be possible for a company to have more than one contact
  email address?
- Do you /really/ want to store the user's password in your DB?  Look
  towards salts and SHA/MD5 sums.
- If you have more than a few people with the same company, are you at
  all worried about disk space?
- Disk contention is often the bottleneck, if your DB can't fit entirely
  in main memory.  Having less places to update means better disk
  access.
- Usage patterns, as you described, are also a concern.  Logging in is
  an issue as is accessing other data.  What's the ratio of
  currently-logging-in-users to other data requests?  No need to pull
  the entire data row if you're not going to use most of the disk pages.
- Will you have mainly INSERT queries, mainly SELECT, UPDATE,
  DELETE, a combination?  DB's and engines are better suited to
  different types of workloads.
- Are you worried about integrity of your data?  How many foreign
  key constraints will you want?

These all tie in together, and generally beg the question of *your* 
usage patterns.  If this is a project of any import, I can almost 
guarantee that what you think will happen will not align with what 
actually happens.  With that in mind, having the agility of multiple 
tables with correct data (read: use foreign key constraints) will likely 
behoove you.


You might want to take a look at some articles on normalization and 
schema design.  Wikipedia is a good starting pace.


Kevin

At 12:30p -0500 on 18 Jan 2008, Alex K wrote:

Well the basic information, company description and personalized
options will be selected many times (whenever a user submits a query).
It will basically be show on the result page of the search engine.

The user's login / password well is used to login, then the user may
update the company basic information, description and personalized
options. These updates may happen sporadically though. Once every 3
minutes these fields are selected again in order to update the search
engine index.


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



RE: creating temp file, modifying data and putting into other table

2008-01-18 Thread Saravanan
Kerry,

Post the error you get.

First select the database you are going to use in the right panel.
execute the create table statement.
update the table.
execute the select statement as last.

Saravanan



--- On Sat, 1/19/08, Kerry Frater [EMAIL PROTECTED] wrote:

 From: Kerry Frater [EMAIL PROTECTED]
 Subject: RE: creating temp file, modifying data and putting into other table
 To: [EMAIL PROTECTED], 'Sebastian Mendel' [EMAIL PROTECTED], 'MySql' 
 mysql@lists.mysql.com
 Date: Saturday, January 19, 2008, 12:45 AM
 Yes it is the mysql browser. I have tried one after the
 other with the same
 result.
 
 So it looks as though I am using the wrong testbed
 
 Kerrry
 
 -Original Message-
 From: Saravanan [mailto:[EMAIL PROTECTED] 
 Sent: 18 January 2008 15:12
 To: 'Sebastian Mendel'; 'MySql';
 [EMAIL PROTECTED]
 Subject: RE: creating temp file, modifying data and putting
 into other table
 
 Hi,
 
 Are you using mysql browser? If yes. It will run only the
 current line
 statement. It will not execute all the three statements. So
 try one after
 the other.
 
 Saravanan
 
 
 --- On Fri, 1/18/08, Kerry Frater
 [EMAIL PROTECTED] wrote:
 
  From: Kerry Frater [EMAIL PROTECTED]
  Subject: RE: creating temp file, modifying data and
 putting into other
 table
  To: 'Sebastian Mendel'
 [EMAIL PROTECTED],
 'MySql'
 mysql@lists.mysql.com
  Date: Friday, January 18, 2008, 9:33 PM
  I have just tried it with lowercase with the same
 result.
  
  To test I have opened up the query browser and typed 3
  lines
  
  create temporary table ttable1 (select * from
 testnames
  where ref='ABCDE');
  update ttable1 set ref='12345678';
  select * from ttable1;
  
  I leave the cursor on the 3rd line and click on
 execute. I
  get the result
  
  Testdb.ttable1 doesn't exist error 1146
  
  If I leave the cursor on the first line then it
 appears to
  execute the first
  line as I do not get an error but no data is shown.
  
  Does the browser run a script? Is that why I am
 getting
  problems and I
  should be testing in another way?
  
  Kerry
  
  -Original Message-
  From: Sebastian Mendel
 [mailto:[EMAIL PROTECTED] 
  Sent: 18 January 2008 13:24
  To: [EMAIL PROTECTED]; 'MySql'
  Subject: Re: creating temp file, modifying data and
 putting
  into other table
  
  Kerry Frater schrieb:
   Can someone please advise. I am looking to create
 a
  multiuser friendly
  way
   of getting a subset number of rows from a table
 into
  another whilst making
  a
   modification.
   
   I thought that this could be done using a
 temporary
  table in a batch
  script
   that is unique to that session e.g.
   
   create temporary table Ttable1 (select * from
  masterlist where
  ref='ABCDE');
   update Ttable1 set ref='SMI0C001';
   insert into sublist select * from Ttable1;
   drop Ttable1;
   
   I know the above syntax doesn't work but it
 shows
  the steps I am looking
  to
   take. 
   
   Hope this makes enough sense to be able to
 answer.
  
  did you tried with lowercase table names (ttable1)
 too?
  
  -- 
  Sebastian
  
  
  -- 
  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]
 
 
  
 
 
 Looking for last minute shopping deals?  
 Find them fast with Yahoo! Search.
 http://tools.search.yahoo.com/newsearch/category.php?category=shopping
 
 -- 
 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]


  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

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



Re: upgrading mysql on RHEL4

2008-01-18 Thread Joerg Bruehe
Hi !

perl pra schrieb:
 [[...]]
 
 Also please tell me where can i get mysql5.1 enterprise edition.

5.1 is currently labeled rc (current version is 5.1.22-rc), so there
is no enterprise edition yet.

When there will be one, it will be for paying customers, and they have
got (or will receive) the download instructions.


HTH,
Jörg

-- 
Joerg Bruehe, Senior Production Engineer
MySQL AB, www.mysql.com


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



another slave loading question

2008-01-18 Thread Paul Berry
i have this State when I start a slave: Has read all relay log; waiting for
the slave I/O thread to update it

mysql show processlist;
++-+---+---+-+--+---+--+
| Id | User| Host  | db| Command | Time |
State |
Info |
++-+---+---+-+--+---+--+
| 17 | root| localhost |  | Query   |0 |
NULL  | show
processlist |
| 23 | system user |   | NULL  | Connect |2057 | Has read all
relay log; waiting for the slave I/O thread to update it | NULL
|
++-+---+---+-+--+---+--+
2 rows in set (0.00 sec)


it was started with a mysqldump and is now many hours behind the master
it seems from what i've researched that its now off on the start points and
so it won't ever get through it
can i  LOAD DATA FROM MASTER; to have it clean up, or is there a method or
something i'm missing
thanks!
paul


Re: basic style shema question

2008-01-18 Thread Alex K
Hi Kevin,

Well the basic information, company description and personalized
options will be selected many times (whenever a user submits a query).
It will basically be show on the result page of the search engine.

The user's login / password well is used to login, then the user may
update the company basic information, description and personalized
options. These updates may happen sporadically though. Once every 3
minutes these fields are selected again in order to update the search
engine index.

Thank you,

Alex

On 18/01/2008, Kevin Hunter [EMAIL PROTECTED] wrote:
 At 11:44a -0500 on 18 Jan 2008, Alex K wrote:
  To summarize one table vs. many tables with one to one relations?

 As per usual, it depends on your needs.  For most flexibility, and to
 give the DB the best chance to give the best plan for the possible
 requests I might make in the future, I generally tend towards
 normalization, not denormalization.

 The question is: what do you want to do with the schema?

 Kevin

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



select

2008-01-18 Thread Hiep Nguyen

hi all,

i have a table looks like this:

ID sDate
1  1997-03-21
2  1997-04-30
3  1997-05-30
4  1998-01-29
5  1998-02-24
6  1998-03-21
7  1999-05-10
8  1999-07-12
9  1999-10-20
10 2000-01-01
11 2000-02-15
12 2000-03-20
13 2000-05-18


how do i construct my select statement so that i only get distinct year? 
so the above data will return something like this:


sDate
2000
1999
1998
1997

thanks,
t. hiep

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



Re: creating temp file, modifying data and putting into other table

2008-01-18 Thread Sebastian Mendel

Kerry Frater schrieb:

Can someone please advise. I am looking to create a multiuser friendly way
of getting a subset number of rows from a table into another whilst making a
modification.

I thought that this could be done using a temporary table in a batch script
that is unique to that session e.g.

create temporary table Ttable1 (select * from masterlist where ref='ABCDE');
update Ttable1 set ref='SMI0C001';
insert into sublist select * from Ttable1;
drop Ttable1;

I know the above syntax doesn't work but it shows the steps I am looking to
take. 


Hope this makes enough sense to be able to answer.


did you tried with lowercase table names (ttable1) too?

--
Sebastian


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



Re: Who know this strange problem

2008-01-18 Thread Baron Schwartz
Hi,

On Jan 18, 2008 3:50 AM, Moon's Father [EMAIL PROTECTED] wrote:
 My test is as follows:
 mysql  select g_id from t group by g_id order by g_id desc limit 0,1;
 +--+
 | g_id |
 +--+
 |6 |
 +--+
 1 row in set (0.00 sec)

 mysql  select g_id from t group by g_id order by g_id desc limit 0,1 into
 @tmp_id;
 Query OK, 1 row affected (0.00 sec)

 mysql select @tmp_id;
 +-+
 | @tmp_id |
 +-+
 |   5 |
 +-+

Try it this way:

mysql select @tmp_id := g_id from t group by g_id order by g_id desc
limit 0,1;
+-+
| @tmp_id := g_id |
+-+
|   6 |
+-+
1 row in set (0.00 sec)

mysql select @tmp_id;
+-+
| @tmp_id |
+-+
| 6   |
+-+

This seems like a bug to me.  You should file a bug report at bugs.mysql.com.

 1 row in set (0.00 sec)

 mysql select version();
 +-+
 | version()   |
 +-+
 | 5.1.21-beta-log |
 +-+
 1 row in set (0.00 sec)

 mysql


 But the variabe @tmp_id 's value is 5;
 Any help is appreciated.

 Here is my test data.

 DROP TABLE IF EXISTS `t`;

 CREATE TABLE `t` (
   `id` int(11) NOT NULL auto_increment,
   `g_id` int(11) NOT NULL,
   `t_str` varchar(255) NOT NULL,
   PRIMARY KEY  (`id`),
   key (`g_id`)
 ) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8;

 /*Data for the table `t` */

 insert  into `t`(`id`,`g_id`,`t_str`) values
 (1,2,'wo'),
 (2,2,'ni'),
 (3,2,'ta'),
 (4,3,'wo '),
 (5,4,'ni'),
 (6,3,'ni'),
 (7,4,'ta'),
 (8,3,'wang'),
 (9,4,'li'),
 (10,3,'hai'),
 (11,4,'ri'),
 (12,2,'ren'),
 (13,5,'ta'),
 (14,6,'ri'),
 (15,6,'ren'),
 (16,6,'fuck'),
 (17,6,'shit'),
 (18,5,'ls'),
 (19,5,'chmod'),
 (20,5,'chgrp'),
 (21,5,'chown'),
 (22,3,'rm'),
 (23,3,'desc'),
 (24,4,'pwd'),
 (25,5,'cd');


 --
 I'm a mysql DBA in china.
 More about me just visit here:
 http://yueliangdao0608.cublog.cn


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



Re: turn a slave back into its own master

2008-01-18 Thread Saravanan
i am ok with this

mysql change master to master_host='';
Query OK, 0 rows affected (0.01 sec)

mysql show slave status\G
Empty set (0.01 sec)

Saravanan


--- On Sat, 1/19/08, Paul Berry [EMAIL PROTECTED] wrote:

 From: Paul Berry [EMAIL PROTECTED]
 Subject: Re: turn a slave back into its own master
 To: [EMAIL PROTECTED]
 Cc: MySql mysql@lists.mysql.com
 Date: Saturday, January 19, 2008, 6:03 AM
 thanks - i think i'm ok because
 i get these results
 mysql show slave status;
 Empty set (0.00 sec)
 
 
 
 On 1/18/08, Saravanan [EMAIL PROTECTED] wrote:
 
  Hi,
 
  will removing the master.info help instead of
 executing change master?
 
  or
  stop slave;
  reset master;
 
 
  --- On Sat, 1/19/08, Paul Berry
 [EMAIL PROTECTED] wrote:
 
   From: Paul Berry [EMAIL PROTECTED]
   Subject: Re: turn a slave back into its own
 master
   To: MySql
 mysql@lists.mysql.com
   Date: Saturday, January 19, 2008, 5:31 AM
   i ended up doing this - it seems to have worked
 fine
  
   STOP SLAVE;
   SHOW SLAVE STATUS;
   CHANGE MASTER TO
 MASTER_HOST='',
 MASTER_PORT=0,
 MASTER_USER='',
 MASTER_PASSWORD='';
   RESET MASTER;
  
  
  
   On 1/18/08, Paul Berry
 [EMAIL PROTECTED]
   wrote:
   
hi guys, quick question
   
how do i undo a CHANGE MASTER TO command and
 make it a
   master of itself
again?
thanks 
   
 
 
 
   
 
  Never miss a thing.  Make Yahoo your home page.
  http://www.yahoo.com/r/hs
 


  

Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

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



Re: another slave loading question

2008-01-18 Thread Saravanan

Hi,

I am new to MySQL. I am not sure how to set timezones. But your slave status 
and slave processlist doesn't show any problem. It replicated  correctly and 
wait for I/O thread to update the relay log.

use '\G' instead of ';'

Saravanan

--- On Sat, 1/19/08, Paul Berry [EMAIL PROTECTED] wrote:

 From: Paul Berry [EMAIL PROTECTED]
 Subject: Re: another slave loading question
 To: [EMAIL PROTECTED], MySql mysql@lists.mysql.com
 Date: Saturday, January 19, 2008, 8:16 AM
 hi thanks for the quick answer ! these 2 servers are in
 different timezones
 - do i need to set the slave server to the master
 slave's timezone?
 
 i'm giong to research implementing that right away - in
 the meantime i
 thought this might help show some information
 
 i have this on the master:
 
 mysql show master status;
 ++--+--+--+
 | File   | Position | Binlog_Do_DB |
 Binlog_Ignore_DB |
 ++--+--+--+
 | dp3-bin.02 |  5382028 | * |  |
 ++--+--+--+
 1 row in set (0.00 sec)
 
 
 and this on the slave:
 
 mysql show slave status;
 ++--+-+-+---+-+-++---+---+--+---+-+-+++-+-+++--+-+-+-++---++++-+---++---+
 | Slave_IO_State | Master_Host  | Master_User | Master_Port
 | Connect_Retry
 | Master_Log_File | Read_Master_Log_Pos | Relay_Log_File   
  |
 Relay_Log_Pos | Relay_Master_Log_File | Slave_IO_Running |
 Slave_SQL_Running
 | Replicate_Do_DB | Replicate_Ignore_DB |
 Replicate_Do_Table |
 Replicate_Ignore_Table | Replicate_Wild_Do_Table |
 Replicate_Wild_Ignore_Table | Last_Errno | Last_Error |
 Skip_Counter |
 Exec_Master_Log_Pos | Relay_Log_Space | Until_Condition |
 Until_Log_File |
 Until_Log_Pos | Master_SSL_Allowed | Master_SSL_CA_File |
 Master_SSL_CA_Path
 | Master_SSL_Cert | Master_SSL_Cipher | Master_SSL_Key |
 Seconds_Behind_Master |
 ++--+-+-+---+-+-++---+---+--+---+-+-+++-+-+++--+-+-+-++---++++-+---++---+
 || *   | * |   13306 | 
   60 |
 dp3-bin.02  | 4126670 |
 *-sql-relay-bin.02|
233 |
 dp3-bin.02| No   | Yes 
  | *
 ;  | |
 ||
 | |  0 ||  
  0
 | 4126670 | 233 | None|
 | 0 | No |
 || |  
 |
 |   |
 ++--+-+-+---+-+-++---+---+--+---+-+-+++-+-+++--+-+-+-++---++++-+---++---+
 1 row in set (0.00 sec)
 
 
 
 
 
 On 1/18/08, Saravanan [EMAIL PROTECTED] wrote:
 
  did you check time in master and slave servers?
 
  saravanan
 
 
  --- On Sat, 1/19/08, Paul Berry
 [EMAIL PROTECTED] wrote:
 
   From: Paul Berry [EMAIL PROTECTED]
   Subject: another slave loading question
   To: MySql
 mysql@lists.mysql.com
   Date: Saturday, January 19, 2008, 7:56 AM
   i have this State when I start a slave: Has read
 all relay
   log; waiting for
   the slave I/O thread to update it
  
   mysql show processlist;
  
 
 

Re: turn a slave back into its own master

2008-01-18 Thread Paul Berry
i ended up doing this - it seems to have worked fine

STOP SLAVE;
SHOW SLAVE STATUS;
CHANGE MASTER TO
  MASTER_HOST='',
  MASTER_PORT=0,
  MASTER_USER='',
  MASTER_PASSWORD='';
RESET MASTER;



On 1/18/08, Paul Berry [EMAIL PROTECTED] wrote:

 hi guys, quick question

 how do i undo a CHANGE MASTER TO command and make it a master of itself
 again?
 thanks