Re: upgrading mysql

2010-01-13 Thread Lawrence Sorrillo
The issue is that in theory this should work given the facts announced 
by MySQL regarding binary logging and replication.
I can certainly do it the way you propose, but to my mind I should also 
be able to do it using the fact that both machines are fully synced and 
hence at
that point I should be able to to local respective dumps and restores 
and still be in sync.


Anyone knows anything special about position 106? It seems to be the 
very initial position in MySQL 5.1 servers?


mysql show master status;
+---+--+--+--+
| File  | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+---+--+--+--+
| X-bin.01 |  106 |  |  |
+---+--+--+--+
1 row in set (0.00 sec)



r...@:/usr/local/mysql/data ] /usr/local/mysql/bin/mysqlbinlog 
mssdb2-bin.01

/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#100113 13:50:40 server id 5  end_log_pos 106   Start: binlog v 4, 
server v 5.1.42-log created 100113 13:50:40 at startup

# Warning: this binlog is either in use or was not closed properly.
ROLLBACK/*!*/;
BINLOG '
ABZOSw8FZgAAAGoBAAQANS4xLjQyLWxvZwAA
Fk5LEzgNAAgAEgAEBAQEEgAAUwAEGggICAgC
'/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET completion_ty...@old_completion_type*/;
r...@:/usr/local/mysql/data ]

~Lawrence




Tom Worster wrote:

Frankly, I didn't entirely understand what you were proposing. I got lost
around step 6.

Is the issue total time for the procedure or service downtime?


On 1/12/10 12:58 PM, Lawrence Sorrillo sorri...@jlab.org wrote:

  

This is two upgrades done in sequence(the reload takes about three hours
per machine) . I can do what I am proposing in parallel.

Do you see it as problematic?

~Lawrence


Tom Worster wrote:


How about:

1 shut down the slave, upgrade it, restart it, let it catch up.

2 shut down the master, upgrade it, restart it, let the slave catch up.

?





On 1/12/10 12:34 PM, Lawrence Sorrillo sorri...@jlab.org wrote:

  
  

Hi:

I want to upgrade a master and slave server from mysql 4.1 to mysql 5.1.

I want to so something like follows:

1. Stop all write access to the master server.
2. Ensure that replication on the slave is caught up to the last change
on the master.
3. stop binary logging on the master.
4. stop replication on the slave.
5. dump the master, stop old 4.1 server, start new 5.1 server and reload
master dump file under 5.1 server ( binary logging is turned off)
6. dump the slave, stop old 4.1 server, start new 5.1 server and reload
slave dump file under 5.1 server.
7. After loading is complete, test then start binary logging on master
while still preventing updates to updates.
8. After loading slave, test then start slave (get configs in place and
restart server).

I am thinking that in this scenario I dont have to bother with recording
binlog file names and position etc etc.
That both servers will have the same databases abd replication and
binary logging will start on the two databases with no data loss and
continue forward.


Comments?

~Lawrence





  
  





  




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



upgrading mysql

2010-01-12 Thread Lawrence Sorrillo

Hi:

I want to upgrade a master and slave server from mysql 4.1 to mysql 5.1.

I want to so something like follows:

1. Stop all write access to the master server.
2. Ensure that replication on the slave is caught up to the last change 
on the master.

3. stop binary logging on the master.
4. stop replication on the slave.
5. dump the master, stop old 4.1 server, start new 5.1 server and reload 
master dump file under 5.1 server ( binary logging is turned off)
6. dump the slave, stop old 4.1 server, start new 5.1 server and reload 
slave dump file under 5.1 server.
7. After loading is complete, test then start binary logging on master 
while still preventing updates to updates.
8. After loading slave, test then start slave (get configs in place and 
restart server).


I am thinking that in this scenario I dont have to bother with recording 
binlog file names and position etc etc.
That both servers will have the same databases abd replication and 
binary logging will start on the two databases with no data loss and 
continue forward.



Comments?

~Lawrence




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: upgrading mysql

2010-01-12 Thread Lawrence Sorrillo
This is two upgrades done in sequence(the reload takes about three hours 
per machine) . I can do what I am proposing in parallel.


Do you see it as problematic?

~Lawrence


Tom Worster wrote:

How about:

1 shut down the slave, upgrade it, restart it, let it catch up.

2 shut down the master, upgrade it, restart it, let the slave catch up.

?





On 1/12/10 12:34 PM, Lawrence Sorrillo sorri...@jlab.org wrote:

  

Hi:

I want to upgrade a master and slave server from mysql 4.1 to mysql 5.1.

I want to so something like follows:

1. Stop all write access to the master server.
2. Ensure that replication on the slave is caught up to the last change
on the master.
3. stop binary logging on the master.
4. stop replication on the slave.
5. dump the master, stop old 4.1 server, start new 5.1 server and reload
master dump file under 5.1 server ( binary logging is turned off)
6. dump the slave, stop old 4.1 server, start new 5.1 server and reload
slave dump file under 5.1 server.
7. After loading is complete, test then start binary logging on master
while still preventing updates to updates.
8. After loading slave, test then start slave (get configs in place and
restart server).

I am thinking that in this scenario I dont have to bother with recording
binlog file names and position etc etc.
That both servers will have the same databases abd replication and
binary logging will start on the two databases with no data loss and
continue forward.


Comments?

~Lawrence







  




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: upgrading mysql

2010-01-12 Thread Lawrence Sorrillo

Hi:

I want to ensure that right after the reload that the same data is 
present in both the master and the slave. They are in perfect sync. Then 
I think its safe to consider starting binary logging and replication 
etc. And after these are started, changes can start?


And in setting up replication in this manner I would not use the CHANGE 
MASTER... I will just


master-host=xxx.xxx.xxx.xxx
master-connect-retry=60
master-user=auser
master-password=apassword

in the my.cnf file and restart the slave server. From there it should 
start reading the binary logs and committing changes properly.


Is this correct?

~Lawrence


Shawn Green wrote:

Lawrence Sorrillo wrote:

Hi:

I want to upgrade a master and slave server from mysql 4.1 to mysql 5.1.

I want to so something like follows:

1. Stop all write access to the master server.


ok

2. Ensure that replication on the slave is caught up to the last 
change on the master.


why? You are just going to replace it later.


3. stop binary logging on the master.


why? You can just disconnect the slave



4. stop replication on the slave.


You can do this at step 2. Just issue STOP SLAVE IO_THREAD;  The SQL 
thread can keep moving along.


5. dump the master, stop old 4.1 server, start new 5.1 server and 
reload master dump file under 5.1 server ( binary logging is turned off)


Yes. No need to create binary logs for the rebuild.

6. dump the slave, stop old 4.1 server, start new 5.1 server and 
reload slave dump file under 5.1 server.


There is a faster way.

7. After loading is complete, test then start binary logging on 
master while still preventing updates to updates.


Once you have QA-ed your new 5.1 master, you can shut it down then 
copy the entire image (binaries and all) directly to the slave 
machine.  This is much faster than rebuilding from a dump and it 
ensures that you have identical data to start replication with.


After the copy, then restart the master with binary logging.


8. After loading slave, test then start slave (get configs in place 
and restart server).




Yes, it's always good to test any server image before putting it online.

The CHANGE MASTER TO command to use for the slave will be at position 
4 of the first binary log created after the binary image was captured.



I am thinking that in this scenario I dont have to bother with 
recording binlog file names and position etc etc.
That both servers will have the same databases abd replication and 
binary logging will start on the two databases with no data loss and 
continue forward.


You are correct. Because you are re-imaging your slave from your 
master, there is no need to track binary log or relay log positions.


See also:
http://dev.mysql.com/doc/refman/5.1/en/replication-howto-rawdata.html

** SAFETY ADVICE ** - always ensure you have a clean binary backup of 
any server you want to perform major maintenance to. In the off-chance 
that something does happen to go wrong, you will have it available for 
the fastest possible restore-to-original-state







--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Exporting the result of a Query into excel

2010-01-05 Thread Lawrence Sorrillo

Carsten:

Can you demonstrate this?

~Lawrence

Carsten Pedersen wrote:
Is there any particular reason not to use the MySQL ODBC driver to 
import the data directly into Excel?


/ Carsten

Jim Lyons skrev:
A command to convert the table mytab in database mydb into a 
tab-delimited

file mytab.txt might be:

mysql -e'select * from mydb.mytab' -sss   mytab.txt

The -sss is necessary to remove all the formatting stuff that you 
normally

have in the output of a select statement.

An alternative, if you have a directory *** that mysql can write to ***:

mysqldump --tab=/home/mysql/temp mydb mytab

This will create 2 files in /home/mysql/temp:  mytab.txt and 
mytab.sql.  The

one you'll want is in mytab.txt.

Then use what transfer tool you have, ftp, scp, winscp, rsync to 
transfer

the file to another server.

On Tue, Jan 5, 2010 at 7:31 AM, ishaq gbola ishaq...@yahoo.co.uk 
wrote:


Thanks a lot for that, but where does this file get saved in and how 
can i

copy it to my local host if the database is on a remote server

--- On Tue, 5/1/10, Jay Ess li...@netrogenic.com wrote:

From: Jay Ess li...@netrogenic.com
Subject: Re: Exporting the result of a Query into excel
To: mysql@lists.mysql.com  Mysql mysql@lists.mysql.com
Date: Tuesday, 5 January, 2010, 13:22

ishaq gbola wrote:

Hi all,

I would like to know if there is a tool or command in mySQL that 
allows

one to export the result of query into excel formart
select * from table into outfile thefile.txt;
That can be imported into excel using CSV and using TAB as separator.
http://code.anjanesh.net/2007/12/export-mysql-data-to-excel-compatible.html 



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=ishaq...@yahoo.co.uk

















--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Weird SQL Results

2009-09-01 Thread Lawrence Sorrillo
Are you doing the insert and the select in different sessions, ie 
different connections to the server(different terminals)?
This might simply be an intended symptom of isolation levels and InnoDB 
MVCC(multi versioning concurrency control).


In addition, can you tell us what you get from:

mysql select version();
mysql select @@tx_isolation;


Thanks.

Tachu® wrote:
I'm having some weird issues that might be common but im not sure. I 
have a very write intensive innodb table that sometimes i do an insert 
and then do a select for the row i just inserted and it wont show up. 
this is on the same host its not replication lag but on the same host. 
on different transaction. Is this a know issue? is there something i 
can do to prevent this??


Thanks

T






--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: backup from a slave

2009-05-05 Thread Lawrence Sorrillo
Are the values of these variables all accessible via the command: show 
variables?



Josh Miller wrote:

MAS! wrote:
btw, I have to get the  Master_Log_File and Read_Master_Log_Pos or 
Relay_Master_Log_File and Exec_Master_Log_Pos to start the new slave 
correctly !?


If the Master_Log_File and Exec_Master_Log_Pos are not equivalent, 
you'll want to note the Exec_Master_Log_Pos value as that is the value 
which determines where in the binary logs you're slave is currently at.







--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org