You probably want to pass the --master-data option to the mysqldump; it
will add the relay log position of the master to the dump file, which
will help with the set-up.
You should also either prevent any writes to the master database during
the dump, or if you are using InnoDB use the --single-transaction
option, to prevent the data in the dump being inconsistent.
On Tue, 2009-09-22 at 11:39 -0400, Andrei F wrote:
> I'm trying to fix a MySQL replication issue. Currently here are major
> discrepancies between the master and the slave.
> Replication has been broken for the past couple of weeks. Here's my plan,
> please correct me if I'm wrong:
> 1) grab a dump of the master (server) database: mysqldump -u -p dbname >
> 2) drop the slave/partially replicated database on the slave server: drop
> database <dbname>
> 3) import the db dump created at step #1 into the slave server.
> 4) start replication.
> 5) get rid of old binary log cruft that's no longer needed.
> Again, please correct me if I'm wrong.