RE: using the bin-log approach on the master side, how can I accomplish my replication objectives

2012-05-03 Thread Brown, Charles
Hello Nitin,

Please give Nitin a prize. What a quiet genius she is. Now, I get it. Now, I 
can see clearly.
I’ve tried it and it worked.

Thanks so much.

From: Nitin Mehta [mailto:ntn...@yahoo.com]
Sent: Wednesday, May 02, 2012 11:25 PM
To: Brown, Charles
Cc: mysql@lists.mysql.com
Subject: Re: using the bin-log approach on the master side, how can I 
accomplish my replication objectives

Hi Charles,
I believe you would already have bin-log configured, is that right? If not, you 
need to.
Secondly, If you think the bin-log generated for the entire stack of 
databases/schemas is too big, you may want to restrict it using binlog-do-db 
BUT that may create problem if you have any DMLs which run in the below manner:
mysql use db1;
mysql update db2.tb2 
You may be surprised to find that this update will not be recorded in master's 
bin-log if you have set binlog-do-db=db2.
To sum it up, if you're not very sure, simply enable bin-log on master and use 
replicate-do-table on slave. So in one word response to your question, no!
Hope that helps!
Also, please reply to all so the people, helping you, know about the status of 
your problem.


Regards,

From: Brown, Charles cbr...@bmi.commailto:cbr...@bmi.com
To: Nitin Mehta ntn...@yahoo.commailto:ntn...@yahoo.com
Sent: Thursday, May 3, 2012 9:27 AM
Subject: RE: using the bin-log approach on the master side, how can I 
accomplish my replication objectives

Hello Nitin,
Help Me!  Using your approach, do I have to put anything on  the master 
“my.cnf”.

Thanks


From: Nitin Mehta [mailto:ntn...@yahoo.com]
Sent: Wednesday, May 02, 2012 10:51 PM
To: Brown, Charles; Rick James; a.sm...@ukgrid.netmailto:a.sm...@ukgrid.net; 
mysql@lists.mysql.commailto:mysql@lists.mysql.com
Subject: Re: using the bin-log approach on the master side, how can I 
accomplish my replication objectives

I guess, it only makes things even more simple.

You should use replicate-do-table=db1.tb1 and so one in slave's cnf to ensure 
that only this particular table gets replicated. However, all the databases on 
master will get bin-logged and you may or may not want to do that.

So making it even simpler:

on the slave:

replicate-do-table=db1.tb1
replicate-do-table=db2.tb2
replicate-do-table=db3.tb3
You might want to have a look at :
http://dev.mysql.com/doc/refman/5.5/en/replication-options-slave.html#option_mysqld_replicate-do-table
http://dev.mysql.com/doc/refman/5.5/en/replication-rules.html

Hope this helps!

From: Brown, Charles cbr...@bmi.commailto:cbr...@bmi.com
To: Rick James rja...@yahoo-inc.commailto:rja...@yahoo-inc.com; 
a.sm...@ukgrid.netmailto:a.sm...@ukgrid.net 
a.sm...@ukgrid.netmailto:a.sm...@ukgrid.net; 
mysql@lists.mysql.commailto:mysql@lists.mysql.com 
mysql@lists.mysql.commailto:mysql@lists.mysql.com
Sent: Thursday, May 3, 2012 8:51 AM
Subject: using the bin-log approach on the master side, how can I accomplish my 
replication objectives

Hello Rick,

I think I'll go with your recommendations - but help me here a little bit. 
Because all look fuzzy like a brain surgery. So make it simple and clean for me.



For the sake of simplicity, here is what my master has:

Database: db1

Tables: db1tb1, db1tb2, db1tb3



Database: db2

Tables: db2tb1, db2tb2, db2tb3



Database: db3

Tables: db3tb1, db3tb2, db3tb3



Now, I would like to replicate only these tables that belong to respective 
databases:

db1tb1, db2tb2, and db3tb3



My question is: using the bin-log approach on the master side, how can I 
accomplish my replication objectives? Help me



Best regards and thanks








This message is intended only for the use of the Addressee and
may contain information that is PRIVILEGED and CONFIDENTIAL.

If you are not the intended recipient, you are hereby notified
that any dissemination of this communication is strictly prohibited.

If you have received this communication in error, please erase
all copies of the message and its attachments and notify us
immediately.

Thank you.


This message is intended only for the use of the Addressee and
may contain information that is PRIVILEGED and CONFIDENTIAL.
If you are not the intended recipient, you are hereby notified
that any dissemination of this communication is strictly prohibited.
If you have received this communication in error, please erase
all copies of the message and its attachments and notify us
immediately.
Thank you.




This message is intended only for the use of the Addressee and
may contain information that is PRIVILEGED and CONFIDENTIAL.

If you are not the intended recipient, you are hereby notified
that any dissemination of this communication is strictly prohibited.

If you have received this communication in error, please erase
all copies of the message and its attachments and notify us

master BIN-LOG maintenace

2012-05-03 Thread Brown, Charles
Hi  Gurus,

I would like to set BIN-LOG maintenance procedure for my master. The master is 
on a windows platform. I’m all for make it simple and clean therefore I’ve been 
leaning toward   the automatic BIN-LOG removal “expire-logs-days=7”. The 
problem is for this option to work, it should be preceded by a “BIN-LOG FLUSH” 
command. Okay, where do I go from here in order to make this work. Please help 
me.

Thanks



This message is intended only for the use of the Addressee and
may contain information that is PRIVILEGED and CONFIDENTIAL.

If you are not the intended recipient, you are hereby notified
that any dissemination of this communication is strictly prohibited.

If you have received this communication in error, please erase
all copies of the message and its attachments and notify us
immediately.

Thank you.



Re: master BIN-LOG maintenace

2012-05-03 Thread Nitin Mehta
Hi Charles,
 
I guess your application doesn't generate too much of binary logs. The 
parameter expire-logs-days kicks in at the flush but does not necessarily 
require a manual flush logs command. You can reduce the value of 
max_binlog_size to make sure that at least one new file is created daily and 
this will force mysql to check and delete old bin-logs. The default (and 
maximum) value for this variable is 1G. If I'm not wrong, it is a dynamic 
variable, which means you can try different values without a restart of the 
database until you find a suitable one.
 
Hope that helps!
 
Regards,
 


 From: Brown, Charles cbr...@bmi.com
To: Nitin Mehta ntn...@yahoo.com 
Cc: mysql@lists.mysql.com mysql@lists.mysql.com 
Sent: Thursday, May 3, 2012 4:24 PM
Subject: master BIN-LOG maintenace
  
Hi  Gurus,

I would like to set BIN-LOG maintenance procedure for my master. The master is 
on a windows platform. I’m all for make it simple and clean therefore I’ve been 
leaning toward   the automatic BIN-LOG removal “expire-logs-days=7”. The 
problem is for this option to work, it should be preceded by a “BIN-LOG FLUSH” 
command. Okay, where do I go from here in order to make this work. Please help 
me.

Thanks



This message is intended only for the use of the Addressee and
may contain information that is PRIVILEGED and CONFIDENTIAL.

If you are not the intended recipient, you are hereby notified
that any dissemination of this communication is strictly prohibited.

If you have received this communication in error, please erase
all copies of the message and its attachments and notify us
immediately.

Thank you.


Re: using the bin-log approach on the master side, how can I accomplish my replication objectives

2012-05-03 Thread Nitin Mehta
Thanks for your kind words, Charles! It comes easily to you when you have 
experienced it. I'm glad it worked for you.

 


 From: Brown, Charles cbr...@bmi.com
To: Nitin Mehta ntn...@yahoo.com 
Cc: mysql@lists.mysql.com mysql@lists.mysql.com 
Sent: Thursday, May 3, 2012 3:17 PM
Subject: RE: using the bin-log approach on the master side, how can I 
accomplish my replication objectives
  
Hello Nitin,

Please give Nitin a prize. What a quiet genius she is. Now, I get it. Now, I 
can see clearly.
I’ve tried it and it worked.

Thanks so much.

From: Nitin Mehta [mailto:ntn...@yahoo.com]
Sent: Wednesday, May 02, 2012 11:25 PM
To: Brown, Charles
Cc: mysql@lists.mysql.com
Subject: Re: using the bin-log approach on the master side, how can I 
accomplish my replication objectives

Hi Charles,
I believe you would already have bin-log configured, is that right? If not, you 
need to.
Secondly, If you think the bin-log generated for the entire stack of 
databases/schemas is too big, you may want to restrict it using binlog-do-db 
BUT that may create problem if you have any DMLs which run in the below manner:
mysql use db1;
mysql update db2.tb2 
You may be surprised to find that this update will not be recorded in master's 
bin-log if you have set binlog-do-db=db2.
To sum it up, if you're not very sure, simply enable bin-log on master and use 
replicate-do-table on slave. So in one word response to your question, no!
Hope that helps!
Also, please reply to all so the people, helping you, know about the status of 
your problem.


Regards,

From: Brown, Charles cbr...@bmi.commailto:cbr...@bmi.com
To: Nitin Mehta ntn...@yahoo.commailto:ntn...@yahoo.com
Sent: Thursday, May 3, 2012 9:27 AM
Subject: RE: using the bin-log approach on the master side, how can I 
accomplish my replication objectives

Hello Nitin,
Help Me!  Using your approach, do I have to put anything on  the master 
“my.cnf”.

Thanks


From: Nitin Mehta [mailto:ntn...@yahoo.com]
Sent: Wednesday, May 02, 2012 10:51 PM
To: Brown, Charles; Rick James; a.sm...@ukgrid.netmailto:a.sm...@ukgrid.net; 
mysql@lists.mysql.commailto:mysql@lists.mysql.com
Subject: Re: using the bin-log approach on the master side, how can I 
accomplish my replication objectives

I guess, it only makes things even more simple.

You should use replicate-do-table=db1.tb1 and so one in slave's cnf to ensure 
that only this particular table gets replicated. However, all the databases on 
master will get bin-logged and you may or may not want to do that.

So making it even simpler:

on the slave:

replicate-do-table=db1.tb1
replicate-do-table=db2.tb2
replicate-do-table=db3.tb3
You might want to have a look at :
http://dev.mysql.com/doc/refman/5.5/en/replication-options-slave.html#option_mysqld_replicate-do-table
 
http://dev.mysql.com/doc/refman/5.5/en/replication-rules.html 

Hope this helps!

From: Brown, Charles cbr...@bmi.commailto:cbr...@bmi.com
To: Rick James rja...@yahoo-inc.commailto:rja...@yahoo-inc.com; 
a.sm...@ukgrid.netmailto:a.sm...@ukgrid.net 
a.sm...@ukgrid.netmailto:a.sm...@ukgrid.net; 
mysql@lists.mysql.commailto:mysql@lists.mysql.com 
mysql@lists.mysql.commailto:mysql@lists.mysql.com
Sent: Thursday, May 3, 2012 8:51 AM
Subject: using the bin-log approach on the master side, how can I accomplish my 
replication objectives

Hello Rick,

I think I'll go with your recommendations - but help me here a little bit. 
Because all look fuzzy like a brain surgery. So make it simple and clean for me.



For the sake of simplicity, here is what my master has:

Database: db1

Tables: db1tb1, db1tb2, db1tb3



Database: db2

Tables: db2tb1, db2tb2, db2tb3



Database: db3

Tables: db3tb1, db3tb2, db3tb3



Now, I would like to replicate only these tables that belong to respective 
databases:

db1tb1, db2tb2, and db3tb3



My question is: using the bin-log approach on the master side, how can I 
accomplish my replication objectives? Help me



Best regards and thanks








This message is intended only for the use of the Addressee and
may contain information that is PRIVILEGED and CONFIDENTIAL.

If you are not the intended recipient, you are hereby notified
that any dissemination of this communication is strictly prohibited.

If you have received this communication in error, please erase
all copies of the message and its attachments and notify us
immediately.

Thank you.


This message is intended only for the use of the Addressee and
may contain information that is PRIVILEGED and CONFIDENTIAL.
If you are not the intended recipient, you are hereby notified
that any dissemination of this communication is strictly prohibited.
If you have received this communication in error, please erase
all copies of the message and its attachments and notify us
immediately.
Thank you.




RE: master BIN-LOG maintenace

2012-05-03 Thread Rick James
Or look at how old your one binlog is, and how big it is.  Do a little 
arithmetic to see the avg bytes per day; set max_binlog_size to that.

Expire-logs probably only deletes old binlogs, and does not split any binlogs.  
So what you have now will not really do anything until you have 2 binlogs, and 
the older one is  7 days old.  That may not happen for months.  Even with the 
FLUSH you asked about, the expire may not kick in until 14 or more days.

 -Original Message-
 From: Nitin Mehta [mailto:ntn...@yahoo.com]
 Sent: Thursday, May 03, 2012 4:20 AM
 To: mysql@lists.mysql.com
 Subject: Re: master BIN-LOG maintenace
 
 Hi Charles,
 
 I guess your application doesn't generate too much of binary logs. The
 parameter expire-logs-days kicks in at the flush but does not
 necessarily require a manual flush logs command. You can reduce the
 value of max_binlog_size to make sure that at least one new file is
 created daily and this will force mysql to check and delete old bin-
 logs. The default (and maximum) value for this variable is 1G. If I'm
 not wrong, it is a dynamic variable, which means you can try different
 values without a restart of the database until you find a suitable one.
 
 Hope that helps!
 
 Regards,
 
 
 
  From: Brown, Charles cbr...@bmi.com
 To: Nitin Mehta ntn...@yahoo.com
 Cc: mysql@lists.mysql.com mysql@lists.mysql.com
 Sent: Thursday, May 3, 2012 4:24 PM
 Subject: master BIN-LOG maintenace
 
 Hi  Gurus,
 
 I would like to set BIN-LOG maintenance procedure for my master. The
 master is on a windows platform. I’m all for make it simple and clean
 therefore I’ve been leaning toward   the automatic BIN-LOG removal
 “expire-logs-days=7”. The problem is for this option to work, it should
 be preceded by a “BIN-LOG FLUSH” command. Okay, where do I go from here
 in order to make this work. Please help me.
 
 Thanks
 
 
 
 This message is intended only for the use of the Addressee and may
 contain information that is PRIVILEGED and CONFIDENTIAL.
 
 If you are not the intended recipient, you are hereby notified that any
 dissemination of this communication is strictly prohibited.
 
 If you have received this communication in error, please erase all
 copies of the message and its attachments and notify us immediately.
 
 Thank you.
 

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



RE: using the bin-log approach on the master side, how can I accomplish my replication objectives

2012-05-03 Thread Rick James
That surprise happens whether you filter it on the master or on the slave.  The 
problem is that some tables got updated; some did not.

The only viable workaround (that I know of) is to use the wild filtering -- 
this forces the filtering to actually look at the query, not simply use the USE.

 -Original Message-
 From: Nitin Mehta [mailto:ntn...@yahoo.com]
 Sent: Wednesday, May 02, 2012 9:25 PM
 To: Brown, Charles
 Cc: mysql@lists.mysql.com
 Subject: Re: using the bin-log approach on the master side, how can I
 accomplish my replication objectives
 
 Hi Charles,
 I believe you would already have bin-log configured, is that right? If
 not, you need to.
 Secondly, If you think the bin-log generated for the entire stack of
 databases/schemas is too big, you may want to restrict it using
 binlog-do-db BUT that may create problem if you have any DMLs which
 run in the below manner:
 mysql use db1;
 mysql update db2.tb2 
 You may be surprised to find that this update will not be recorded in
 master's bin-log if you have set binlog-do-db=db2.
 To sum it up, if you're not very sure, simply enable bin-log on master
 and use replicate-do-table on slave. So in one word response to your
 question, no!
 Hope that helps!
 Also, please reply to all so the people, helping you, know about the
 status of your problem.
 
 
 Regards,
 
 
 
 
  From: Brown, Charles cbr...@bmi.com
 To: Nitin Mehta ntn...@yahoo.com
 Sent: Thursday, May 3, 2012 9:27 AM
 Subject: RE: using the bin-log approach on the master side, how can I
 accomplish my replication objectives
 
 
 Hello Nitin,
 Help Me!  Using your approach, do I have to put anything on  the master
 “my.cnf”.
 
 Thanks
 
 
 From:Nitin Mehta [mailto:ntn...@yahoo.com]
 Sent: Wednesday, May 02, 2012 10:51 PM
 To: Brown, Charles; Rick James; a.sm...@ukgrid.net;
 mysql@lists.mysql.com
 Subject: Re: using the bin-log approach on the master side, how can I
 accomplish my replication objectives
 
 I guess, it only makes things even more simple.
 
 You should use replicate-do-table=db1.tb1 and so one in slave's cnf
 to ensure that only this particular table gets replicated. However, all
 the databases on master will get bin-logged and you may or may not want
 to do that.
 
 So making it even simpler:
 
 on the slave:
 
 replicate-do-table=db1.tb1
 replicate-do-table=db2.tb2
 replicate-do-table=db3.tb3
 You might want to have a look at :
 http://dev.mysql.com/doc/refman/5.5/en/replication-options-
 slave.html#option_mysqld_replicate-do-table
 http://dev.mysql.com/doc/refman/5.5/en/replication-rules.html
 
 Hope this helps!
 
 From:Brown, Charles cbr...@bmi.com
 To: Rick James rja...@yahoo-inc.com; a.sm...@ukgrid.net
 a.sm...@ukgrid.net; mysql@lists.mysql.com mysql@lists.mysql.com
 Sent: Thursday, May 3, 2012 8:51 AM
 Subject: using the bin-log approach on the master side, how can I
 accomplish my replication objectives
 
 Hello Rick,
 
 I think I'll go with your recommendations - but help me here a little
 bit. Because all look fuzzy like a brain surgery. So make it simple and
 clean for me.
 
 
 
 For the sake of simplicity, here is what my master has:
 
 Database: db1
 
 Tables: db1tb1, db1tb2, db1tb3
 
 
 
 Database: db2
 
 Tables: db2tb1, db2tb2, db2tb3
 
 
 
 Database: db3
 
 Tables: db3tb1, db3tb2, db3tb3
 
 
 
 Now, I would like to replicate only these tables that belong to
 respective databases:
 
 db1tb1, db2tb2, and db3tb3
 
 
 
 My question is: using the bin-log approach on the master side, how can
 I accomplish my replication objectives? Help me
 
 
 
 Best regards and thanks
 
 
 
 
 
 
 
 
 This message is intended only for the use of the Addressee and
 may contain information that is PRIVILEGED and CONFIDENTIAL.
 
 If you are not the intended recipient, you are hereby notified
 that any dissemination of this communication is strictly prohibited.
 
 If you have received this communication in error, please erase
 all copies of the message and its attachments and notify us
 immediately.
 
 Thank you.
 
 
 
 
 This message is intended only
 for the use of the Addressee and
 may contain information that is PRIVILEGED
 and CONFIDENTIAL.
 If you are not the intended recipient, you are hereby notified
 that any
 dissemination of this communication is strictly prohibited.
 If you have received this communication in error, please erase
 all copies
 of the message and its attachments and notify us
 immediately.
 Thank you.
 


mixing and matching mysql mssql whileloop within an if case

2012-05-03 Thread Haluk Karamete
Please take a look at the following code and tell me if there is a way
around it.

if ($current_server_is_mysql):
while ($row = mysql_fetch_assoc($RS)) {
else:
while( $row = sqlsrv_fetch_array( $RS, SQLSRV_FETCH_ASSOC)){
endif:
Depending on the server I'm working with, I'd like to compile my
records into the $RS recordset the proper/native way. If I can get
pass this part, the rest should be all right cause both mysql and
mssql $row can be tapped into the same way. For example,
$row['fieldname'] will give me the field value whether the row was a
mysql or mssql resource. So it all boils down to the above snippet
failing.

The error I get points to the else: part in the above snippet.

Parse error: syntax error, unexpected T_ELSE in
D:\Hosting\5291100\html\blueprint\pages\populate_migration_table.php
on line 415
I can understand why I am getting this error.

But, I'm hoping you guys can offer a work-around it without me
resorting to duplicate the entire while loop she-bang.

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



RE: mixing and matching mysql mssql whileloop within an if case

2012-05-03 Thread Rick James
opinion
Cross-platform coding is folly.  There are too many differences (LIMIT, ROWNUM, 
SEQUENCE vs AUTO_INCREMENT, ...) that you either stumble over, or end up 
special casing, or you simply code to the least common denominator, thereby 
getting poor performance on all platforms.
/opinion

 -Original Message-
 From: Haluk Karamete [mailto:halukkaram...@gmail.com]
 Sent: Thursday, May 03, 2012 10:21 AM
 To: MySQL
 Subject: mixing and matching mysql  mssql whileloop within an if case
 
 Please take a look at the following code and tell me if there is a way
 around it.
 
 if ($current_server_is_mysql):
 while ($row = mysql_fetch_assoc($RS)) {
 else:
 while( $row = sqlsrv_fetch_array( $RS, SQLSRV_FETCH_ASSOC)){
 endif:
 Depending on the server I'm working with, I'd like to compile my
 records into the $RS recordset the proper/native way. If I can get pass
 this part, the rest should be all right cause both mysql and mssql $row
 can be tapped into the same way. For example, $row['fieldname'] will
 give me the field value whether the row was a mysql or mssql resource.
 So it all boils down to the above snippet failing.
 
 The error I get points to the else: part in the above snippet.
 
 Parse error: syntax error, unexpected T_ELSE in
 D:\Hosting\5291100\html\blueprint\pages\populate_migration_table.php
 on line 415
 I can understand why I am getting this error.
 
 But, I'm hoping you guys can offer a work-around it without me
 resorting to duplicate the entire while loop she-bang.
 
 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql


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



Re: mixing and matching mysql mssql whileloop within an if case

2012-05-03 Thread Brown, Charles


Sent from my iPhone

On May 3, 2012, at 1:02 PM, Haluk Karamete halukkaram...@gmail.com wrote:

 Please take a look at the following code and tell me if there is a way
 around it.
 
 if ($current_server_is_mysql):
while ($row = mysql_fetch_assoc($RS)) {
 else:
while( $row = sqlsrv_fetch_array( $RS, SQLSRV_FETCH_ASSOC)){
 endif:
 Depending on the server I'm working with, I'd like to compile my
 records into the $RS recordset the proper/native way. If I can get
 pass this part, the rest should be all right cause both mysql and
 mssql $row can be tapped into the same way. For example,
 $row['fieldname'] will give me the field value whether the row was a
 mysql or mssql resource. So it all boils down to the above snippet
 failing.
 
 The error I get points to the else: part in the above snippet.
 
 Parse error: syntax error, unexpected T_ELSE in
 D:\Hosting\5291100\html\blueprint\pages\populate_migration_table.php
 on line 415
 I can understand why I am getting this error.
 
 But, I'm hoping you guys can offer a work-around it without me
 resorting to duplicate the entire while loop she-bang.
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql
 

This message is intended only for the use of the Addressee and
may contain information that is PRIVILEGED and CONFIDENTIAL.

If you are not the intended recipient, you are hereby notified
that any dissemination of this communication is strictly prohibited.

If you have received this communication in error, please erase
all copies of the message and its attachments and notify us
immediately.

Thank you.


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



Re: mixing and matching mysql mssql whileloop within an if case

2012-05-03 Thread Baron Schwartz
Haluk,

I could suggest a number of ways around the if/else construct, such as
creating a subclass for the various servers with a uniform interface
and hiding the differences inside the class. The actual error that you
showed is much simpler, however: you are mixing curly-brace style with
what I like to call visual basic style of PHP. You have an opening
curly-brace without a closing one (and an empty while-loop to boot).
You can use either-or style, but you can't mix them and leave unclosed
braces as you've done below :-)

On Thu, May 3, 2012 at 1:20 PM, Haluk Karamete halukkaram...@gmail.com wrote:
 Please take a look at the following code and tell me if there is a way
 around it.

 if ($current_server_is_mysql):
    while ($row = mysql_fetch_assoc($RS)) {
 else:
    while( $row = sqlsrv_fetch_array( $RS, SQLSRV_FETCH_ASSOC)){
 endif:
 Depending on the server I'm working with, I'd like to compile my
 records into the $RS recordset the proper/native way. If I can get
 pass this part, the rest should be all right cause both mysql and
 mssql $row can be tapped into the same way. For example,
 $row['fieldname'] will give me the field value whether the row was a
 mysql or mssql resource. So it all boils down to the above snippet
 failing.

 The error I get points to the else: part in the above snippet.

 Parse error: syntax error, unexpected T_ELSE in
 D:\Hosting\5291100\html\blueprint\pages\populate_migration_table.php
 on line 415
 I can understand why I am getting this error.

 But, I'm hoping you guys can offer a work-around it without me
 resorting to duplicate the entire while loop she-bang.

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




-- 
Baron Schwartz
Win free MySQL conference tickets! http://goo.gl/mvZ4W

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



Myisam won't support replication

2012-05-03 Thread Brown, Charles
I noticed that my replication stopped working after migrating to MySQL cluster. 
My current engine is myisam. Does anyone have an idea why repl won't work. Do I 
have to use the ndbengine?  


This message is intended only for the use of the Addressee and
may contain information that is PRIVILEGED and CONFIDENTIAL.

If you are not the intended recipient, you are hereby notified
that any dissemination of this communication is strictly prohibited.

If you have received this communication in error, please erase
all copies of the message and its attachments and notify us
immediately.

Thank you.


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



Re: Myisam won't support replication

2012-05-03 Thread Andrew Moore
Charles,

How do you know your replication isn't working?



On Thu, May 3, 2012 at 9:50 PM, Brown, Charles cbr...@bmi.com wrote:

 I noticed that my replication stopped working after migrating to MySQL
 cluster. My current engine is myisam. Does anyone have an idea why repl
 won't work. Do I have to use the ndbengine?

 
 This message is intended only for the use of the Addressee and
 may contain information that is PRIVILEGED and CONFIDENTIAL.

 If you are not the intended recipient, you are hereby notified
 that any dissemination of this communication is strictly prohibited.

 If you have received this communication in error, please erase
 all copies of the message and its attachments and notify us
 immediately.

 Thank you.
 

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




RE: Myisam won't support replication

2012-05-03 Thread Rick James
If I am not mistaken, NDB Cluster replication is separate from InnoDB/MyISAM.  
Perhaps you set one up, but not the other?

 -Original Message-
 From: Andrew Moore [mailto:eroomy...@gmail.com]
 Sent: Thursday, May 03, 2012 2:35 PM
 To: Brown, Charles
 Cc: MySQL; DC
 Subject: Re: Myisam won't support replication
 
 Charles,
 
 How do you know your replication isn't working?
 
 
 
 On Thu, May 3, 2012 at 9:50 PM, Brown, Charles cbr...@bmi.com wrote:
 
  I noticed that my replication stopped working after migrating to
 MySQL
  cluster. My current engine is myisam. Does anyone have an idea why
  repl won't work. Do I have to use the ndbengine?
 
  
  This message is intended only for the use of the Addressee and may
  contain information that is PRIVILEGED and CONFIDENTIAL.
 
  If you are not the intended recipient, you are hereby notified that
  any dissemination of this communication is strictly prohibited.
 
  If you have received this communication in error, please erase all
  copies of the message and its attachments and notify us immediately.
 
  Thank you.
  
 
  --
  MySQL General Mailing List
  For list archives: http://lists.mysql.com/mysql
  To unsubscribe:http://lists.mysql.com/mysql
 
 

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



Myisam won't support replication in an MySQL Cluster environment

2012-05-03 Thread Brown, Charles
Does anyone have idea or experienced in MySQL Cluster configured for 
bi-directional replication. Please advise me if you have to use NDBcluster 
engine in order to get replication between the data nodes. I'm using MYISAM on 
several tables that will not replicate.



This message is intended only for the use of the Addressee and
may contain information that is PRIVILEGED and CONFIDENTIAL.

If you are not the intended recipient, you are hereby notified
that any dissemination of this communication is strictly prohibited.

If you have received this communication in error, please erase
all copies of the message and its attachments and notify us
immediately.

Thank you.



Myisam won't support replication in an MySQL Cluster environment

2012-05-03 Thread Brown, Charles
Does anyone have idea or experienced in MySQL Cluster configured for 
bi-directional replication. Please advise me if you have to use NDBcluster 
engine in order to get replication between the data nodes. I'm using MYISAM on 
several tables that will not replicate.



This message is intended only for the use of the Addressee and
may contain information that is PRIVILEGED and CONFIDENTIAL.

If you are not the intended recipient, you are hereby notified
that any dissemination of this communication is strictly prohibited.

If you have received this communication in error, please erase
all copies of the message and its attachments and notify us
immediately.

Thank you.



Re: mixing and matching mysql mssql whileloop within an if case

2012-05-03 Thread Alex Schaft

  
  
I suppose an easier way is to have a getrow function, Something like

while ($row = getrow($RS) {
  .
  .
  .
  }
  
  function getrow($RS)
  
  {
  if ($current_server_is_mysql)
  {
   return mysql_fetch_assoc($RS);
 }
 else
 { 
  return sqlsrv_fetch_array( $RS, SQLSRV_FETCH_ASSOC);
 }
} 



On 2012/05/03 19:20, Haluk Karamete wrote:

  Please take a look at the following code and tell me if there is a way
around it.

if ($current_server_is_mysql):
while ($row = mysql_fetch_assoc($RS)) {
else:
while( $row = sqlsrv_fetch_array( $RS, SQLSRV_FETCH_ASSOC)){
endif:
Depending on the server I'm working with, I'd like to compile my
records into the $RS recordset the proper/native way. If I can get
pass this part, the rest should be all right cause both mysql and
mssql $row can be tapped into the same way. For example,
$row['fieldname'] will give me the field value whether the row was a
mysql or mssql resource. So it all boils down to the above snippet
failing.

The error I get points to the else: part in the above snippet.

Parse error: syntax error, unexpected T_ELSE in
D:\Hosting\5291100\html\blueprint\pages\populate_migration_table.php
on line 415
I can understand why I am getting this error.

But, I'm hoping you guys can offer a work-around it without me
resorting to duplicate the entire while loop she-bang.





--