Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3323556
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:19:00+00:00 2026-05-17T23:19:00+00:00

I have to set up a new mysql replication replicating two databases. So I

  • 0

I have to set up a new mysql replication replicating two databases. So I have this script which locks tables, makes a dump and unlocks them.

runme.sh

mysql -uxxx -pxxx < 1.sql >> logpos.txt
mysqldump -uXXX -pXXX db1 > db1.sql
mysqldump -uXXX -pXXX db2 > db2.sql
mysql -uxxx -pxxx < 2.sql >> logpos.txt

first sql file locks tables and exports master status:

1.sql

FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;

second file exports master status and unlocks tables

2.sql

SHOW MASTER STATUS;
UNLOCK TABLES;

the result looks like this:

logpos.txt

File    Position        Binlog_Do_DB    Binlog_Ignore_DB
mysql-bin.000335        49106285        fli_search,flimmit
File    Position        Binlog_Do_DB    Binlog_Ignore_DB
mysql-bin.000335        49139991        fli_search,flimmit

Question:
How can the log position change while tables are locked?

Server version:  5.0.51a-24+lenny4-log (Debian)

I could do mysqldump for multiple databases and add –master-data, but I somehow felt unsafe because there are different database formats involved and I couldn’t really find out how mysqldump –master-data behaves with multiple databases. So I had this script and got different log positions…. any idea why? I cannot use this to set up a replication…

UPDATE:

I finally decided to set up replication with mysqldump --master-data --databases db1 db2
the dump was created tonight at 1 am.
today at about 10 am i set up the slave. i totally cleared the databases (dropped all tables) and imported the dump, which automatically set the master log file and log pos correctly. i checked that its the same as in the sql dump. everything looked fine.
of course i stopped the slave before importing (otherwise i couldnt import the dump with change master to statement anway).
i started the slave and eveyrthing looked just fine. the log pos increased, the seconds behind master decreased and went to 0 and some test data was replicated correctly.

but a major update from today ~7am (the time window between the dump creation and importing) was just missing. it pruned old records from a table, on the slave they were still present…
any idea why?

any additional information needeD? comment…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:19:01+00:00Added an answer on May 17, 2026 at 11:19 pm

    looks like i also have to do:

    FLUSH TABLES WITH WRITE LOCK;
    

    the master data switch seems to be unrelyable…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set up transactional replication between two SQL Servers on different ends of
Suppose I have a set of commits in a repository folder... 123 (250 new
Suppose I have a class public class MyClass { private Set<String> set = new
We have a client that needs to set up N local databases, each one
I have APC installed via cPanel everything worked just fine until I set new
I have a MySQL database which contains a table of users. The primary key
I have set up a login system that checks a mysql db validating username,hashed
I'm trying to connect to a different machine: $this->_connection = new PDO(mysql: host=MYSQL_SERVER; dbname=MYSQL_DATABASE,MYSQL_USER,
I have found this example on StackOverflow: var people = new List<Person> { new
We have set up a system where notifications get sent to a user with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.