2,187
edits
m (→Maintenance: Added "Skip Replication Errors") |
(Removed categories) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Depreciated|category=MySQL}} | |||
See the official [http://dev.mysql.com/doc/ MySQL documentation] for further info. | See the official [http://dev.mysql.com/doc/ MySQL documentation] for further info. | ||
Line 319: | Line 321: | ||
START SLAVE; | START SLAVE; | ||
</source> | </source> | ||
=== Restart Replication === | |||
If replication is completely broken, or the slave no longer has an accurate copy of the master. | |||
# Create dump from master | |||
#* <code> mysqldump -u root -p --master-data --all-databases --flush-privileges | gzip -1 > /var/tmp/replication.sql.gz </code> | |||
# Copy to slave | |||
#* EG <code> scp /var/tmp/replication.sql.gz root@10.1.1.55:/var/tmp/. </code> | |||
# Stop slave if still running | |||
#* In MySQL - <code>STOP SLAVE;</code> | |||
# Import into slave | |||
#* <code> zcat /var/tmp/replication.sql.gz | mysql -u root -p</code> | |||
# Start slave | |||
#* In MySQL - <code>START SLAVE;</code> | |||
=== Remove Old Binary Logs === | === Remove Old Binary Logs === | ||
Line 346: | Line 362: | ||
To create a blank copy of a database (ie with a schema but no data) follow the procedure above but use the <code>-d</code> option when creating the dump, so | To create a blank copy of a database (ie with a schema but no data) follow the procedure above but use the <code>-d</code> option when creating the dump, so | ||
* <code> mysqldump -u root -p -d sourcedb > sourcedb-schema.sql </code> | * <code> mysqldump -u root -p -d sourcedb > sourcedb-schema.sql </code> | ||